Re: comdlg32: Remove the font sample characters string.
On Wed, Jan 18, 2012 at 10:12, Francois Gouget <fgouget(a)free.fr> wrote:
The sample text does not depend on the dialog language but on the scripts supported by the font. As such translating it in the resource file makes no sense. - CTEXT "AaBbYyZz",stc5,103,80,109,24,SS_NOPREFIX | NOT WS_VISIBLE + CTEXT "",stc5,103,80,109,24,SS_NOPREFIX | NOT WS_VISIBLE
Actually it's used to show a sample in the font picker (e.g. with wordpad do Format > Font). I translated it in French using most common/representative French characters (including accentuated letters). I wouldn't remove it, but rather add a message context clarifying what its purpose is. If the sample text does not depend on the dialogue language, that's what should be done instead IMHO Frédéric
On Wed, 18 Jan 2012, Frédéric Delanoy wrote:
On Wed, Jan 18, 2012 at 10:12, Francois Gouget <fgouget(a)free.fr> wrote:
The sample text does not depend on the dialog language but on the scripts supported by the font. As such translating it in the resource file makes no sense. - CTEXT "AaBbYyZz",stc5,103,80,109,24,SS_NOPREFIX | NOT WS_VISIBLE + CTEXT "",stc5,103,80,109,24,SS_NOPREFIX | NOT WS_VISIBLE
Actually it's used to show a sample in the font picker (e.g. with wordpad do Format > Font).
No it's not. The code overwrites this string when drawing the dialog and then based on the entry selected in the 'Script:' combobox (cmb5). See CFn_WMPaint(): if( GetWindowInfo( GetDlgItem( hDlg, stc5), &info ) ) { ... DrawTextW( hdc, sample_lang_text[CHARSET_ORDER[lpcf->lpLogFont->lfCharSet]], -1, &info.rcWindow, DT_CENTER|DT_VCENTER|DT_SINGLELINE ); ... So the string which is in the resource file is useless and only causes grief. -- Francois Gouget <fgouget(a)free.fr> http://fgouget.free.fr/ A polar bear is a cartesian bear after a coordinate transform.
2012/1/18 Francois Gouget <fgouget(a)free.fr>:
On Wed, 18 Jan 2012, Frédéric Delanoy wrote:
On Wed, Jan 18, 2012 at 10:12, Francois Gouget <fgouget(a)free.fr> wrote:
The sample text does not depend on the dialog language but on the scripts supported by the font. As such translating it in the resource file makes no sense. - CTEXT "AaBbYyZz",stc5,103,80,109,24,SS_NOPREFIX | NOT WS_VISIBLE + CTEXT "",stc5,103,80,109,24,SS_NOPREFIX | NOT WS_VISIBLE
Actually it's used to show a sample in the font picker (e.g. with wordpad do Format > Font).
No it's not. The code overwrites this string when drawing the dialog and then based on the entry selected in the 'Script:' combobox (cmb5). See CFn_WMPaint():
if( GetWindowInfo( GetDlgItem( hDlg, stc5), &info ) ) { ... DrawTextW( hdc, sample_lang_text[CHARSET_ORDER[lpcf->lpLogFont->lfCharSet]], -1, &info.rcWindow, DT_CENTER|DT_VCENTER|DT_SINGLELINE ); ...
So the string which is in the resource file is useless and only causes grief.
That's why I later added: "If the sample text does not depend on the dialogue language, that's what should be done instead IMHO" i.e. alter the code so it does use the (translatable) string instead of removing it altogether. I should have been clearer in my initial reply, though. Frédéric
Frédéric Delanoy wrote:
2012/1/18 Francois Gouget <fgouget(a)free.fr>:
On Wed, 18 Jan 2012, Frédéric Delanoy wrote:
On Wed, Jan 18, 2012 at 10:12, Francois Gouget <fgouget(a)free.fr> wrote:
The sample text does not depend on the dialog language but on the scripts supported by the font. As such translating it in the resource file makes no sense. - CTEXT "AaBbYyZz",stc5,103,80,109,24,SS_NOPREFIX | NOT WS_VISIBLE + CTEXT "",stc5,103,80,109,24,SS_NOPREFIX | NOT WS_VISIBLE Actually it's used to show a sample in the font picker (e.g. with wordpad do Format > Font). No it's not. The code overwrites this string when drawing the dialog and then based on the entry selected in the 'Script:' combobox (cmb5). See CFn_WMPaint():
if( GetWindowInfo( GetDlgItem( hDlg, stc5), &info ) ) { ... DrawTextW( hdc, sample_lang_text[CHARSET_ORDER[lpcf->lpLogFont->lfCharSet]], -1, &info.rcWindow, DT_CENTER|DT_VCENTER|DT_SINGLELINE ); ...
So the string which is in the resource file is useless and only causes grief.
That's why I later added:
"If the sample text does not depend on the dialogue language, that's what should be done instead IMHO"
i.e. alter the code so it does use the (translatable) string instead of removing it altogether. And what Francois is saying is that that isn't possible as the string depends on the font and not on the UI language. So if I select a Klingon font that has no latin characters I won't be able to see the "AaBbYyZz".
bye michael
2012/1/18 Michael Stefaniuc <mstefani(a)redhat.com>:
And what Francois is saying is that that isn't possible as the string depends on the font and not on the UI language. So if I select a Klingon font that has no latin characters I won't be able to see the "AaBbYyZz".
bye michael
OK. Got it. Must have sounded Klingon to me somehow ;) Frédéric
participants (3)
-
Francois Gouget -
Frédéric Delanoy -
Michael Stefaniuc