flat assembler
Message board for the users of flat assembler.
 Home   FAQ   Search   Register 
 Profile   Log in to check your private messages   Log in 
flat assembler > Windows > gdi text, asian characters

Author
Thread Post new topic Reply to topic
vivik



Joined: 29 Oct 2016
Posts: 396

gdi text, asian characters

So, I just tried to render a string that contains both english and japanese characters, and used "Courier New" font for that. Both were displayed correctly. And I'm pretty sure that Courier New doesn't have any japanese support in it. Which font was used for japanese?


Code:
                        HDC dc;
                        res = pdds->GetDC(&dc);
                        if (res !DD_OKFUCK();


                        //TEXT("Courier New")
                        //TEXT("Impact")
                        //TEXT("MS PGothic")
                        //msgothic.ttc
                        HFONT hFont = CreateFont(24,0,0,0,FW_DONTCARE,FALSE,FALSE,FALSE,DEFAULT_CHARSET,OUT_OUTLINE_PRECIS,
                CLIP_DEFAULT_PRECIS,CLEARTYPE_QUALITYFIXED_PITCH,TEXT("Courier New"));

                        SelectObject(dchFont);


                        RECT rect;
                        rect.top = 0;
                        rect.left = 0;
                        rect.right = 64;
                        rect.bottom = 64;
                        //DrawTextW(dcL"hello!", -1, &rectDT_NOCLIP);
                        DrawTextW(dcL"はっはっは!suckers!lWlW", -1, &rectDT_NOCLIP);
                        pdds->ReleaseDC(dc); //it's just a number



Result:

Image


Last edited by vivik on 07 Jun 2018, 17:05; edited 2 times in total
Post 07 Jun 2018, 16:52
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 15791
Location: Misner space

MS have been updating the font sets with lots of characters.

You can use the "character map" program to browse the available characters in each font.
Post 07 Jun 2018, 16:56
View user's profile Send private message Visit poster's website Reply with quote
vivik



Joined: 29 Oct 2016
Posts: 396

msgothic.ttc is 9MB, cour.ttf is 700KB, I can tell the difference without even opening them. I need to understand in which fonts windows seeks, if needed characters are missing.
Post 07 Jun 2018, 17:15
View user's profile Send private message Reply with quote
shoorick



Joined: 25 Feb 2005
Posts: 1590
Location: Ukraine

MS windows has font linking feature, some font with chinese characters is linked to the courier, and if courier font does not contain certain character the system searches linked fonts for such character.
Linking of fonts is set up in windows registry (I do not remember exact place)
Post 08 Jun 2018, 05:47
View user's profile Send private message Visit poster's website Reply with quote
vivik



Joined: 29 Oct 2016
Posts: 396

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\FontLink\SystemLink

https://docs.microsoft.com/en-us/globalization/input/font-technology

FontLink doesn't exist on my pc, maybe I can create it though. Looks kinda risky, I can break some other apps.

That same link says: "Each application and each operating system can define its own fallback font for any Unicode script range.". I wonder how though.
Post 08 Jun 2018, 12:41
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >

Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Main index   Download   Documentation   Examples   Message board
Copyright © 2004-2018, Tomasz Grysztar.
Powered by rwasa.