flat assembler
Message board for the users of flat assembler.
Index
> Windows > how do i change font? |
Author |
|
b1528932 29 Dec 2010, 17:00
quote from menu that can change it:
Quote: The system locale determines the default character set (letters, symbols, and numbers) and font used to enter and display information in programs that don't use Unicode. in programs that don't use Unicode! When i use widechar functions, i demand to see \ instead of ¥! |
|||
29 Dec 2010, 17:00 |
|
revolution 29 Dec 2010, 17:43
You change the font like this:
Code: CreateFont ... SelectObject ... TextOut ... b1528932 wrote: Do windows doesnt have universal font containing all glyphs for all code points, so it must change fonts? |
|||
29 Dec 2010, 17:43 |
|
b1528932 29 Dec 2010, 23:41
tell me why not make (extend?) a font to contain all glyphs?
|
|||
29 Dec 2010, 23:41 |
|
mindcooler 30 Dec 2010, 02:41
|
|||
30 Dec 2010, 02:41 |
|
mindcooler 30 Dec 2010, 02:45
|
|||
30 Dec 2010, 02:45 |
|
shoorick 30 Dec 2010, 07:06
there is a font linking in windows 2k/xp also: you can set tahoma to edit window, but it will able to display chinese characters due to linking with another font.
look at registry into HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\FontLink\SystemLink to check it. i've not study it well, so i can not say more how it is used exactly. i just do know that some custom richedits declares unicode support but can not display characters from linked fonts.
|
||||||||||
30 Dec 2010, 07:06 |
|
b1528932 30 Dec 2010, 13:09
what i know about characters:
- system use 2 code pages, ANSI for GUI, and OEM for console. Right or Wrong? - when changing this thing (image below), it not only change default codepages, but also might replace font (glyphs). Its simply not mentioned that font used by widechar functions will be changed.Right or Wrong. - font linking is used only when 'default?' font is missing a glyph. Right or Wrong - windows internally use ansi functions, thats why font change (seconfd image). Right or Wrong image1: image2: please give me answers to those questions, and short explanation if im Wrong. |
|||
30 Dec 2010, 13:09 |
|
shoorick 30 Dec 2010, 15:26
as i do understand, changing system locale changes how system treats ansi characters, no fonts are replaced, just different font used as default (matching to codepage)
font linking is used exactly when character is missing in base font windows nt/2k/xp uses unicode internally (unlike 9x), the default font is changed for ansi applications (not whole font, changed just character set for extended ascii range) _________________ UNICODE forever! |
|||
30 Dec 2010, 15:26 |
|
b1528932 30 Dec 2010, 15:51
No, example character (backslash) is translated to U+0x5C everytime.
Its just graphical representation of u+0x5c (or 0x005C in utf16) changing, thats the whole problem. I would understand it if due to the change of CP i couldnt 'cd \..\', but everything stays the same, except glyph! Meaning that even unicode font is CHANGED! I ask WHY, whats the reason? Why dont they clarify it in help page, that ALL, even unicode programs are AFFECTED in glyph way! Of course that OS still treats characters exactly the same, but its drawing them diffrently! |
|||
30 Dec 2010, 15:51 |
|
revolution 31 Dec 2010, 00:00
b1528932: Did you see the link by mindcooler:
https://board.flatassembler.net/topic.php?p=124332#124332 It explains the backslash problem. The font is not changed, only the character mapping is affected. |
|||
31 Dec 2010, 00:00 |
|
b1528932 31 Dec 2010, 03:06
yes i know about backslash mapping. But tell me how its possible to change mapping (glyph <=> utf16_code) of a character without changing a font? Font IS the mapping, or at elast i think so. If im wrong please tell me how does it work.
|
|||
31 Dec 2010, 03:06 |
|
revolution 31 Dec 2010, 03:18
A font describes the shape of the characters, nothing else. You will still get the Arial font regardless of the character mapping. The hex character 0x5c can be mapped to different glyphs within the same font. The mapping depends upon the locale setting.
Locale English: Char 0x005c maps to glyph 0x005c Locale English: Char 0x00a5 maps to glyph 0x00a5 Locale English: Char 0x20a9 maps to glyph 0x20a9 Locale Japanese: Char 0x005c maps to glyph 0x00a5 Locale Japanese: Char 0x00a5 maps to glyph 0x00a5 Locale Japanese: Char 0x20a9 maps to glyph 0x20a9 Locale Korean: Char 0x005c maps to glyph 0x20a9 Locale Korean: Char 0x00a5 maps to glyph 0x00a5 Locale Korean: Char 0x20a9 maps to glyph 0x20a9 All are still within the Arial (or whatever) font face. |
|||
31 Dec 2010, 03:18 |
|
b1528932 31 Dec 2010, 17:00
So there is something else (not glyph index = utf16 index) that decide about mappings, right? utf16 <=> something <=> glyph. And by changing 'locale?' this something is also changed. Thank you for claryfiing this to me. I belive font is no concern from programmers point of view, it just contain shapes, glyph table is what i want to address.
I can read on manual that locale is just a way of formatting time, date, currency, length, it contain month names, week day names, and so on. Locale is a set of variables to represent the same thing in diffrent ways (world regions). So locale also contain intermediate font - codepoint mapping, interesting. But this doesnt explain why window title bars ALWAYS have glyph 0x005C, regardless of locale! I also have a question about UI and keyboard input. I want to display a message (or any part of UI) in few languages, does the windows support autodetect of wich language user use? GetUserGeoID is for checking where user is located, so i can display weather info or latest news. GetUserDefaultLCID is for checing how should i call 5th day of week, or what length unit to use. GetThreadLocale is same as above, and it should be used instead because user might want to have multiple locales at once. GetUserDefaultUILanguage if for checking what stirng to use. When i detect german language i display german text, when i detect english - i use english. what is locale? wikipedia say 1 thing, microsoft other. What is locale, and how to dump its info, its my main question right now! |
|||
31 Dec 2010, 17:00 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.