News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

64-bit DirectX 11 - Part 4 - Color Fonts

Started by aw27, October 20, 2018, 07:36:49 PM

Previous topic - Next topic

aw27

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--

Jose,

Will you build the EXE as well, I don't have that DX library.

aw27

Hutch,
The .exe is there as well, dx11_64ColorEmodjis.exe  :biggrin:

hutch--

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

TimoVJL

#4
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.
May the source be with you

mabdelouahab


aw27

@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

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

aw27

@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

Quote from: AW on October 21, 2018, 01:02:40 AM
@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)

aw27

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.

aw27

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

#12
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
QuoteFile 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
May the source be with you

mabdelouahab


aw27

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.