Author Topic: 64-bit DirectX 11 - Part 4 - Color Fonts  (Read 4373 times)

AW

  • Member
  • *****
  • Posts: 2442
  • Let's Make ASM Great Again!
64-bit DirectX 11 - Part 4 - Color Fonts
« on: October 20, 2018, 07:36:49 PM »
Color Fonts are appearing everywhere but knowledge about them is not widespread. One way of rendering them is using Direct2D. Since I had previously done some work on Direct2D I made some changes to the posted sample.



You will need Windows 10 (I think Windows 8.1 is enough but did not confirm) and full support for DirectX 11 in your system, including the DX11 SDK because all the LIBs are there.

Lots of color unicode color characters.

Note:
dxMain is saved as UTF-8, make sure your editor can retrieve it.

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 6768
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: 64-bit DirectX 11 - Part 4 - Color Fonts
« Reply #1 on: October 20, 2018, 08:00:33 PM »
Jose,

Will you build the EXE as well, I don't have that DX library.
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :skrewy:

AW

  • Member
  • *****
  • Posts: 2442
  • Let's Make ASM Great Again!
Re: 64-bit DirectX 11 - Part 4 - Color Fonts
« Reply #2 on: October 20, 2018, 08:06:42 PM »
Hutch,
The .exe is there as well, dx11_64ColorEmodjis.exe  :biggrin:

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 6768
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: 64-bit DirectX 11 - Part 4 - Color Fonts
« Reply #3 on: October 20, 2018, 10:08:55 PM »
The animation looks good, if you really want to nitpick, the rotating block has its horizon line the wrong way around when it is at the front of the center block. Nice work  :t
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :skrewy:

TimoVJL

  • Member
  • ***
  • Posts: 476
Re: 64-bit DirectX 11 - Part 4 - Color Fonts
« Reply #4 on: October 20, 2018, 10:25:18 PM »
Windows 8.1
EDIT: updated Segoe UI emoji font
EDIT: a small Direct2D example for Windows 8.1 ->. Only a that happy emoji line and only for PellesC 9, as \Uxxxxxxxx can be a problem with others.
« Last Edit: October 23, 2018, 01:55:36 AM by TimoVJL »
May the source be with you

mabdelouahab

  • Member
  • ***
  • Posts: 430
Re: 64-bit DirectX 11 - Part 4 - Color Fonts
« Reply #5 on: October 20, 2018, 11:29:35 PM »
 :(
Quote
Direct3D Initialization failed

AW

  • Member
  • *****
  • Posts: 2442
  • Let's Make ASM Great Again!
Re: 64-bit DirectX 11 - Part 4 - Color Fonts
« Reply #6 on: October 21, 2018, 01:02:40 AM »
@Hutch,
Well spotted (it helps being a photographer also).  :bgrin:

@Timo,
Yeah, I have included Unicode version 8,9 and 10 characters which are not recognized in Windows 8.1  :(

@mabdelouahab
It is a bit demanding in hardware, I have the same problem if testing from a virtual machine.

felipe

  • Member
  • *****
  • Posts: 1249
  • Eagles are just great!
Re: 64-bit DirectX 11 - Part 4 - Color Fonts
« Reply #7 on: October 21, 2018, 04:30:05 AM »
Looks like another good work  :icon14:, unfortunately i got the direct3d initialization failed probably because i have not installed anything related to directx 11... :redface:
Thanks for sharing...  :t
Felipe.

AW

  • Member
  • *****
  • Posts: 2442
  • Let's Make ASM Great Again!
Re: 64-bit DirectX 11 - Part 4 - Color Fonts
« Reply #8 on: October 21, 2018, 04:12:53 PM »
@Felipe
Direct2D/DirectWrite can't be used directly with D3D 11. Yes, it is the way Microsoft recommends to write text but it needs to be used with a D3D 10.1 device and swap when rendering. I believe this is the root of the problems. When I can I will see if I can make a simpler text writing example not involving D3D.

mabdelouahab

  • Member
  • ***
  • Posts: 430
Re: 64-bit DirectX 11 - Part 4 - Color Fonts
« Reply #9 on: October 21, 2018, 05:16:04 PM »
@mabdelouahab
It is a bit demanding in hardware, I have the same problem if testing from a virtual machine.
I don't think so.
This is a test of D3D11 / hardware (windows 8.1 x64)

AW

  • Member
  • *****
  • Posts: 2442
  • Let's Make ASM Great Again!
Re: 64-bit DirectX 11 - Part 4 - Color Fonts
« Reply #10 on: October 21, 2018, 10:49:28 PM »
Many notebooks have 2 graphics cards in order to save energy with a low-end graphics card good enough for most tasks, and you will have to run the Nvidia configuration to associate a high-performance graphics software with the Nvidia card. This may be a reason.

AW

  • Member
  • *****
  • Posts: 2442
  • Let's Make ASM Great Again!
Re: 64-bit DirectX 11 - Part 4 - Color Fonts
« Reply #11 on: October 22, 2018, 04:29:49 AM »
All right, I made a simple Direct2D application and now it will work for everybody with Windows 10 and Windows 8.1 (I tested in a virtual machine). It will not render in Windows 7 because Windows 7 does not have the Segoe UI Emoji font by default, I don't know if installing it will solve. I am curious to see but I am lazy to try.

Windows 10:


Windows 8.1 (lots of characters missing  :():


Well, I have done it C. I will post the source code when I convert to ASM. It is small and easy to convert but I can't tell when I will do it.
So, for now I only leave the .exe.

TimoVJL

  • Member
  • ***
  • Posts: 476
Re: 64-bit DirectX 11 - Part 4 - Color Fonts
« Reply #12 on: October 22, 2018, 05:16:07 AM »
Windows 8.1 don't render svg.
Window 7 don't render Color fonts, so blank window.

That link was from year 2012 and last update for segoeui is 2018-05-11 in my Windows 7 PC.

EDIT: seguiemj.ttf for M$ Office 2013 and be creative and use 7Zip to unpack it.
         updated Segoe UI emoji font
Quote
File identifier    File name    File version    File size    Date    Time
Seguiemj.ttf    Seguiemj.ttf    Not applicable    1,788,856    18-Jul-2018    14:11
EDIT: for Office 2016
« Last Edit: October 22, 2018, 06:39:20 PM by TimoVJL »
May the source be with you

mabdelouahab

  • Member
  • ***
  • Posts: 430
Re: 64-bit DirectX 11 - Part 4 - Color Fonts
« Reply #13 on: October 22, 2018, 05:35:11 AM »
windows 8.1 x64

AW

  • Member
  • *****
  • Posts: 2442
  • Let's Make ASM Great Again!
Re: 64-bit DirectX 11 - Part 4 - Color Fonts
« Reply #14 on: October 22, 2018, 05:45:15 PM »
Right, no color fun in Windows 7



This is a link to download the Segoe UI Emoji font, the last I posted was for Segoe UI Symbol. However the code I left here yesterday will not render it in Windows 7 because is using the flag D2D1_DRAW_TEXT_OPTIONS_ENABLE_COLOR_FONT.