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, 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.
 Entire forum ➜ MUSHclient ➜ Bug reports ➜ main output font in MUSHclient folder not loading at startup?

main output font in MUSHclient folder not loading at startup?

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


Posted by Fiendish   USA  (2,533 posts)  Bio   Global Moderator
Date Wed 29 May 2019 03:48 AM (UTC)
Message
If I set my output font to be Dina loaded from the MUSHclient folder instead of one of the system installed fonts, when I start up MUSHclient it refuses to actually use the font until I open the world settings and pop open the font selector and then hit ok.

https://github.com/fiendish/aardwolfclientpackage
Top

Posted by Nick Gammon   Australia  (23,046 posts)  Bio   Forum Administrator
Date Reply #1 on Sat 01 Jun 2019 12:10 AM (UTC)
Message
I can't even see in the code what might enable that behaviour. Perhaps use AddFont in world startup?

Template:function=AddFont AddFont

The documentation for the AddFont script function is available online. It is also in the MUSHclient help file.


- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Fiendish   USA  (2,533 posts)  Bio   Global Moderator
Date Reply #2 on Sat 01 Jun 2019 01:55 AM (UTC)

Amended on Sat 01 Jun 2019 01:59 AM (UTC) by Fiendish

Message
Well it's definitely shown as an option when I go to select my output font. And I can choose it, and the setting sticks. It just doesn't work. ¯\ _(ツ)_/¯

https://github.com/fiendish/aardwolfclientpackage
Top

Posted by Nick Gammon   Australia  (23,046 posts)  Bio   Forum Administrator
Date Reply #3 on Sat 01 Jun 2019 10:29 AM (UTC)
Message
What is shown as an option? I'm surprised that it works at all.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Fiendish   USA  (2,533 posts)  Bio   Global Moderator
Date Reply #4 on Sat 01 Jun 2019 04:42 PM (UTC)

Amended on Sat 01 Jun 2019 04:43 PM (UTC) by Fiendish

Message
Quote:
What is shown as an option?

The Dina font. See: https://i.imgur.com/CX5Yxeb.png

https://github.com/fiendish/aardwolfclientpackage
Top

Posted by Nick Gammon   Australia  (23,046 posts)  Bio   Forum Administrator
Date Reply #5 on Sat 01 Jun 2019 10:36 PM (UTC)
Message
Yes, but the font configuration dialog doesn't have any code to load fonts from your current folder. Windows must be doing that.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Fiendish   USA  (2,533 posts)  Bio   Global Moderator
Date Reply #6 on Sun 29 Mar 2020 06:12 AM (UTC)
Message
Ok but that aside, why does MUSHclient happily load the local Dina font when I choose it but then not load the font at startup until I go and choose it again?

https://github.com/fiendish/aardwolfclientpackage
Top

Posted by Fiendish   USA  (2,533 posts)  Bio   Global Moderator
Date Reply #7 on Fri 10 Apr 2020 04:42 AM (UTC)

Amended on Fri 10 Apr 2020 05:35 AM (UTC) by Fiendish

Message
Let's say one of my plugins is adding Dina (they are) and then a user seeing it as an option decides to set it as their main output font.

Is it possible for AddFont to try to run automatically if the world output setting at launch indicates a font that isn't in the MUSHclient space?

https://github.com/fiendish/aardwolfclientpackage
Top

Posted by Fiendish   USA  (2,533 posts)  Bio   Global Moderator
Date Reply #8 on Sat 11 Apr 2020 07:49 PM (UTC)

Amended on Sat 11 Apr 2020 07:54 PM (UTC) by Fiendish

Message
Also, something isn't working right here when I try to do it manually.


Loading this plugin does not update the font display as I would expect:

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE muclient>
<muclient>
<plugin
   name="Dina_test"
   author="Fiendish"
   id="0399d8b2259be90d8a4c3442"
   language="Lua"
   requires="4.00"
   version="1.0"
   >
</plugin>

<script>
<![CDATA[
   AddFont(GetInfo(66).."Dina.fon")
   SetAlphaOption("output_font_name", "Dina")
   SetOption("output_font_height", 10)
   SetOutputFont("Dina", 10)
   Repaint()
]]>
</script>
</muclient>


The font only updates if I open the output font configuration dialog and re-save the current setting.


See this screen recording: https://youtu.be/cWxxuQoO8QA

https://github.com/fiendish/aardwolfclientpackage
Top

Posted by Nick Gammon   Australia  (23,046 posts)  Bio   Forum Administrator
Date Reply #9 on Sun 12 Apr 2020 10:07 PM (UTC)
Message
I can't reproduce that. I tried on Ubuntu Wine and Mac with Crossover Wine. In both cases your plugin worked.

You need to give more details. Exactly what version of MUSHclient, and what operating system (including version of Wine) are you using?

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Fiendish   USA  (2,533 posts)  Bio   Global Moderator
Date Reply #10 on Fri 29 May 2020 04:58 AM (UTC)

Amended on Fri 29 May 2020 05:12 AM (UTC) by Fiendish

Message
I have a new video for you: https://youtu.be/yLxsTrdrfr0

MUSHclient 5.07-pre and 5.06 at least.
macOS 10.14.6 with Wine 5.0 and 5.7 staging where everything else works fine.

Loading a world file that has output_font_name="Dina" and output_font_height="10" ( like this one: https://pastebin.com/raw/41jwn5RW ). This part I believe is key.

I cannot get the output to actually show using Dina 10 until I manually go into world settings and click OK on the font. I can get it to show Dina 8, but I believe that that's because the world file tried to load Dina 10 at startup and failed because Dina had not yet been added.

I think that if the world file specifies a font that doesn't yet exist because it has to be loaded first with AddFont, then MUSHclient should try to call AddFont to load it as the first fallback and then only use the wrong font if that fails. It would require storing the font file path and not just font name if the world font was loaded with AddFont.

https://github.com/fiendish/aardwolfclientpackage
Top

Posted by Fiendish   USA  (2,533 posts)  Bio   Global Moderator
Date Reply #11 on Thu 04 Jun 2020 04:57 AM (UTC)
Message
Even adding this code to the start of CMUSHclientDoc::SetUpOutputWindow doesn't work


  WIN32_FIND_DATA FindFileData;
  HANDLE hFind;
  CString app_dir = ExtractDirectory(App.m_strMUSHclientFileName);
  list<CString> font_globs {app_dir + "*.fon", app_dir + "*.ttf"};
  for (list<CString>::iterator fit = font_globs.begin(); fit != font_globs.end(); fit++) {
    hFind = FindFirstFile(*fit, &FindFileData);
    if (hFind != INVALID_HANDLE_VALUE) {
        do {
            AddSpecialFont(app_dir + FindFileData.cFileName);
        } while (FindNextFile(hFind, &FindFileData) != 0);
    }
  } 


I don't know what to try next.

https://github.com/fiendish/aardwolfclientpackage
Top

Posted by Nick Gammon   Australia  (23,046 posts)  Bio   Forum Administrator
Date Reply #12 on Thu 04 Jun 2020 06:24 AM (UTC)
Message
Sorry for the tardy response. My mind has boggled a bit due to other things happening in the world right now.

(The response is still tardy, I'll try to look at it shortly).

- Nick Gammon

www.gammon.com.au, www.mushclient.com
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.


29,230 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.