[Home] [Downloads] [Search] [Help/forum]


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Bug reports
. . -> [Subject]  WindowFont no-ops if no Repaint after WindowCreate

WindowFont no-ops if no Repaint after WindowCreate

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page


Posted by Fiendish   USA  (2,514 posts)  [Biography] bio   Global Moderator
Date Tue 13 Mar 2018 04:11 PM (UTC)

Amended on Tue 13 Mar 2018 04:13 PM (UTC) by Fiendish

Message

windowinfo = movewindow.install(win, miniwin.pos_top_right, miniwin.create_absolute_location, false, nil, {mouseup=MouseUp, mousedown=LeftClickOnly, dragmove=LeftClickOnly, dragrelease=LeftClickOnly},{x=default_x, y=default_y})
print("WINDOW CREATE", win, WindowCreate(win, windowinfo.window_left, windowinfo.window_top, width, height, windowinfo.window_mode, windowinfo.window_flags, theme.SECONDARY_BODY))
print("FONT", font_id, font_name, font_size, WindowFont(win, font_id, font_name, font_size, false, false, false, false))
print("FONT INFO", font_id, WindowFontInfo(win, font_id, 21), WindowFontInfo(win, font_id, 20))


prints


WINDOW CREATE my_font 0
FONT my_font Dina 8 0
FONT INFO my_font Arial 0


but (identical except for the explicit call to Repaint)


windowinfo = movewindow.install(win, miniwin.pos_top_right, miniwin.create_absolute_location, false, nil, {mouseup=MouseUp, mousedown=LeftClickOnly, dragmove=LeftClickOnly, dragrelease=LeftClickOnly},{x=default_x, y=default_y})
print("WINDOW CREATE", win, WindowCreate(win, windowinfo.window_left, windowinfo.window_top, width, height, windowinfo.window_mode, windowinfo.window_flags, theme.SECONDARY_BODY))
Repaint()
print("FONT", font_id, font_name, font_size, WindowFont(win, font_id, font_name, font_size, false, false, false, false))
print("FONT INFO", font_id, WindowFontInfo(win, font_id, 21), WindowFontInfo(win, font_id, 20))


prints


WINDOW CREATE my_font 0
FONT my_font Dina 8 0
FONT INFO my_font Dina 0

https://github.com/fiendish/aardwolfclientpackage
[Go to top] top

Posted by Nick Gammon   Australia  (22,975 posts)  [Biography] bio   Forum Administrator
Date Reply #1 on Tue 13 Mar 2018 08:51 PM (UTC)

Amended on Tue 27 Mar 2018 03:19 AM (UTC) by Nick Gammon

Message

I can’t reproduce that. Using a minimal (that doesn’t rely upon other code), verifiable example, I get:

The font name is not saved in any MUSHclient structure, but in the Windows font object:

I can’t offhand see why CMiniWindow::FontInfo would not return the correct name, and in any case it does for me.


- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Nick Gammon   Australia  (22,975 posts)  [Biography] bio   Forum Administrator
Date Reply #2 on Tue 13 Mar 2018 08:59 PM (UTC)
Message
Quote:

WindowFont no-ops ...


You can't say that WindowFont no-ops because your own posted example shows that the font is indeed set up. Your point seems to be that the wrong name is returned by WindowFontInfo.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Fiendish   USA  (2,514 posts)  [Biography] bio   Global Moderator
Date Reply #3 on Wed 14 Mar 2018 06:27 AM (UTC)

Amended on Wed 14 Mar 2018 06:39 AM (UTC) by Fiendish

Message
Quote:
You can't say that WindowFont no-ops because your own posted example shows that the font is indeed set up. Your point seems to be that the wrong name is returned by WindowFontInfo.

I noticed that the wrong font was being drawn in a subsequent call to WindowText. This just seemed like a convenient way to communicate it. But if you can't reproduce it, I'll need to look further.

I'm also using Wine, and who knows what shenanigans go on behind the scenes there.

https://github.com/fiendish/aardwolfclientpackage
[Go to top] top

Posted by Fiendish   USA  (2,514 posts)  [Biography] bio   Global Moderator
Date Reply #4 on Sun 18 Mar 2018 04:27 PM (UTC)

Amended on Sun 18 Mar 2018 04:33 PM (UTC) by Fiendish

Message
This might only be an issue in Wine when calling WindowFont during startup using Default charset instead of specifying ANSI. Luckily the OS default isn't that useful when loading a font.

https://github.com/fiendish/aardwolfclientpackage
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


10,759 views.

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at HostDash]