New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIN32SS][FONT] Fix the system logical stock font data #709
Conversation
Some observations when applying PR-709 as is on top of 0.4.10-dev-370-g8f44035: patch has no visible effects for me on: patch will influence: If others think PR-709 is correct from technical POV (and more like 2k3), then I think it's reasonable to commit it. I did not check that part myself! |
My test program I made: |
Could you try this test program in Russian Windows 2003 or XP? |
I have no russian OS available, sorry. |
OEM_FIXED_FONT is SHIFTJIS_CHARSET or OEM_CHARSET. |
It seems like these data are changeable by the user language. Not fixed data. |
@HBelusca: What's your opinion about these screenshots? |
@katahiromz: They look good; I suppose the "discrepancies" between MS and ROS concerning lfPitchAndFamily values come from the fact we do not use the very same font files as Windows? |
win32ss/gdi/ntgdi/freetype.c
Outdated
if (uCodePage == 1) // CP_OEMCP | ||
return OEM_CHARSET; | ||
|
||
if (uCodePage == 2) // CP_MACCP |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't it possible to use the defines names directly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We cannot #include <winnls.h> at here, and if included <windows.h> then compilation will be slow...
win32ss/gdi/ntgdi/freetype.c
Outdated
@@ -160,6 +160,28 @@ static const CHARSETINFO g_FontTci[MAXTCIINDEX] = | |||
{ SYMBOL_CHARSET, CP_SYMBOL, {{0,0,0,0},{FS_SYMBOL,0}} } | |||
}; | |||
|
|||
BYTE FASTCALL IntCharSetFromCodePage(UINT uCodePage) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest to add a comment that refers to gdi/gdi32/objects/font.c!TranslateCharsetInfo() function, in the TCI_SRCCODEPAGE case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK.
win32ss/gdi/gdi32/objects/font.c
Outdated
@@ -1978,6 +1978,7 @@ TranslateCharsetInfo( | |||
while (index < MAXTCIINDEX && !(*lpSrc>>index & 0x0001)) index++; | |||
break; | |||
case TCI_SRCCODEPAGE: | |||
/* ciACP is also referred by IntCharSetFromCodePage() function */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually I was thinking about adding the comment in IntCharSetFromCodePage(), not here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One comment,
other than that, lgtm.
Amazing work!
win32ss/gdi/ntgdi/stockobj.c
Outdated
BOOL bIsCJK; | ||
static const WCHAR SimSun[] = { 0x5B8B, 0x4F53, 0 }; | ||
static const WCHAR MingLiU[] = { 0x7D30, 0x660E, 0x9AD4 }; | ||
static const WCHAR Batang[] = { 0xBC14, 0xD0D5 }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both MingLiU and Batang need a null-terminator, if they are used with wcscpy.
Can we merge this PR even if PR #713 hasn't been merged yet? |
Yeah, OK. There's no significant change in looking. |
Thanks, let's go! |
Purpose
JIRA issue: CORE-14885
This PR will fix the stock font data to improve font selection.