Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ Bug reports ➜ 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 page


Posted by Fiendish   USA  (2,551 posts)  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
Top

Posted by Nick Gammon   Australia  (23,169 posts)  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
Top

Posted by Nick Gammon   Australia  (23,169 posts)  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
Top

Posted by Fiendish   USA  (2,551 posts)  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
Top

Posted by Fiendish   USA  (2,551 posts)  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
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.


14,747 views.

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

Go to topic:           Search the forum


[Go to top] top

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