4.50.16 SetFont bug

50 views
Skip to first unread message

zhong zhao

unread,
Dec 9, 2025, 1:26:53 AM (8 days ago) Dec 9
to SemWare TSE Pro text editor
//Manualy set font to Fixedsys,12,then run this macro
proc main()
    string fontname[32] = ""
    integer pointsize, flags

    GetFont(fontname, pointsize, flags)
    Warn("before Font:",fontname," Size:",pointsize," Flags:",flags)
    SetFont("Fixedsys",12,0)
    GetFont(fontname, pointsize, flags)
    Warn("after  Font:",fontname," Size:",pointsize," Flags:",flags)
end
//befor Font:Fixedsys Size:12 Flags:0
//after Font:Courier New Size:12 Flags:0
//and actual show font Courier New but Fixedsys

Carlo Hogeveen

unread,
Dec 9, 2025, 4:21:48 AM (7 days ago) Dec 9
to sem...@googlegroups.com

> SetFont("Fixedsys",12,0) not working .

For what it is worth, I cannot reproduce this, even after playing with Windows settings and TSE versions.

Carlo



S.E. Mitchell

unread,
Dec 9, 2025, 5:47:47 AM (7 days ago) Dec 9
to sem...@googlegroups.com
I've tried this on two different computers, one with UTF-8 enabled,
and one with not.
I could not reproduce it on either one.
If you like, I can make a debugging version of TSE available, which
should help us to better see what is going on.
--
> --
>
> ---
> You received this message because you are subscribed to the Google Groups "SemWare TSE Pro text editor" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to semware+u...@googlegroups.com.
> To view this discussion visit https://groups.google.com/d/msgid/semware/8807ef8b-ee0f-4ee0-8469-51ed820a762an%40googlegroups.com.

Henriques18

unread,
Dec 9, 2025, 9:05:23 AM (7 days ago) Dec 9
to SemWare TSE Pro text editor
I tried this and also couldn't reproduce this but if I look, when manually setting the fixedsys font, there's no 12 pointsize for fixedsys.
I can vagually remember that if the font not exists windows looks for a replace font which in this case could be Courier New.

Op dinsdag 9 december 2025 om 11:47:47 UTC+1 schreef S.E. Mitchell:

Knud van Eeden

unread,
Dec 9, 2025, 10:48:56 AM (7 days ago) Dec 9
to sem...@googlegroups.com
@ZhongZhao

1, First and for all do you have 'FixedSys' font size 12 indeed on your 
computer (check also the fonts (search for 'fonts' in Microsoft Windows 'search') in Microsoft Windows).

2. Of course if not found with font size 12 on your computer, e.g. in the Microsoft Windows 'fonts' section thus:

2.1. So then as a next step install that 'FixedSys' font but now with font size 12 
on your computer.

2.2. Then try to reproduce it.

2.3. If not reproducible then one of the above is the solution or explanation.

with friendly greetings
Knud van Eeden


zhong zhao

unread,
Dec 10, 2025, 3:50:35 AM (6 days ago) Dec 10
to SemWare TSE Pro text editor
I use Windows 10 Professional (Chinese)
tmp1.jpg
And in TSEPro 4.50.13 is ok.
Yesterday I tried change SetFont("Fixedsys",12,0) to SetFont("Fixedsys",10,0) in above test.s with TSEPro 4.50.16,  have no effect also.

Knud van Eeden

unread,
Dec 10, 2025, 4:48:44 AM (6 days ago) Dec 10
to sem...@googlegroups.com
That should then if possible be further troubleshoot by Semware (if applicable and possible) as this looks thus like a special case 
not possible to reproduce in current Microsoft Windows versions here without very much effort




Carlo Hogeveen

unread,
Dec 10, 2025, 9:04:01 AM (6 days ago) Dec 10
to sem...@googlegroups.com

 

I was able to reproduce this on a virtual machine!

I can now try to find the deciding difference that causes this behavior.

 

Carlo

 

 

 

Carlo Hogeveen

unread,
Dec 10, 2025, 10:31:10 AM (6 days ago) Dec 10
to sem...@googlegroups.com

Here are my findings.
All tests were done with the Windows UTF-8 switch in its default OFF state.

I can reproduce Zhong Zhao's problem, that in GUI TSE v4.50.16 the statement SetFont("FixedSys", 12, 0) no longer sets "FixedSys" but "Courier New".
This happens when in Windows 10 Pro the Windows System Locale is set to "Chinese Simplified (China)", which indirectly sets Windows' default code page to 936.

(This does not change the Windows Display Language, so I did not need to learn Mandarin :-), but beware that it does impact the character set for CMD scripts and applications like Console TSE, which might start failing, for example for files with accented characters.)

The problem does not exist in Windows 11 Pro.
The problem does not exist in GUI TSE v4.50.13.

Sammy's request to try
SetFont("Fixedsys",12,_FONT_CHARSET_, 1)
did not make a difference.

Carlo



zhong zhao

unread,
Dec 10, 2025, 8:46:18 PM (6 days ago) Dec 10
to SemWare TSE Pro text editor
I tryied test.s in WinXP and Win 7 virtual machine on VMWare Workstation:
//after  Font:Terminal Size:12 Flags:2
//and actual show font Terminal but Fixedsys

S.E. Mitchell

unread,
Dec 11, 2025, 6:30:23 AM (5 days ago) Dec 11
to sem...@googlegroups.com
Here is what we know:
If running Windows 10 Pro the Windows System Locale is set to "Chinese
Simplified (China)", which indirectly sets Windows' default code page
to 936.
If we run: SetFont("Fixedsys",12,0)
It will not set Fixedsys, but rather goes to Courier New.
before (v4.50.13) Font:Fixedsys Size:12 Flags:0
after (v4.50.16) Font:Courier New Size:12 Flags:0
and actually shows font Courier New but Fixedsys was requested.

Here are the code changes for fonts from .13 to .16:
----------
.13:
lf.lfCharSet = DEFAULT_CHARSET;
if ((font_charset >= 1 && font_charset < 0xffff) || (font_flags &
_FONT_CHARSET_))
lf.lfCharSet = font_charset;
lf.lfPitchAndFamily = FIXED_PITCH | FF_MODERN;
----------
.16:
lf.lfCharSet = ANSI_CHARSET;
if ((font_charset > 1 && font_charset < 0xffff) || ((font_flags &
_FONT_CHARSET_) && (font_charset != DEFAULT_CHARSET)))
lf.lfCharSet = font_charset;
else if (strcmp(face_name, "Terminal") == 0)
lf.lfCharSet = DEFAULT_CHARSET;
lf.lfPitchAndFamily = FIXED_PITCH | FF_MODERN;
lf.lfQuality = CLEARTYPE_NATURAL_QUALITY;

Notes: font_charset and font_flags are the SetFont() parameters.
Your macro used: SetFont("Fixedsys",12,0)
So font_flags and font_charset are 0.
Values from Windows header files:
ANSI_CHARSET: 0
DEFAULT_CHARSET: 1
OEM_CHARSET: 255

Only two differences I see that might impact this are:
1) v.16 uses ANSI_CHARSET as the charset, instead of DEFAULT_CHARSET
in v.13, when charset is not passed.
2) v.16 adds the lfQuality = CLEARTYPE_NATURAL_QUALITY

So it may be both of those or one of them causing the problem.
The lfCharSet change was to fix the font bug originally reported by Carlo.
The lfQuality change was based on something I read in the Windows documentation.

I'll continue to cipher on this.
> --
>
> ---
> You received this message because you are subscribed to the Google Groups "SemWare TSE Pro text editor" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to semware+u...@googlegroups.com.
> To view this discussion visit https://groups.google.com/d/msgid/semware/348e6b59-c51b-4bd1-912f-98c21dfcc5f9n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages