Page 1 of 1

packaging fonts into module

Posted: Wed Sep 14, 2022 3:16 pm
by neve
Hello I am trying to package a third-party font into my mudlet module/package. The wiki docs give this information:
To install a new font with your package, include the font file in your zip/mpackage and it'll be automatically installed for you.
It's not completely clear to me where in the mpackage zip it belongs. Must it be in the root of the zip, or can it be anywhere? How does "automatically" identify font files in either case? If it is not automatically made available, what debugging steps are recommended?

Is there a way to load a specific font file from a specific location outside of this process? A common font license forbids distributing fonts directly but does allow downloading them, but it seems like this automatic process precludes that entirely.

Thanks.

Re: packaging fonts into module

Posted: Wed Sep 14, 2022 3:44 pm
by Vadi
It can be anywhere, and they are identified using the filename extension.

> Is there a way to load a specific font file from a specific location outside of this process?

no, but are you sure you'll be able to download it even in that case using Mudlet? Typically these things require using a browser

Re: packaging fonts into module

Posted: Wed Sep 14, 2022 4:28 pm
by neve
Any debugging advice on if a font isn't made available automatically? This doesn't seem to work for me at all.


> no, but are you sure you'll be able to download it even in that case using Mudlet? Typically these things require using a browser

Yes, it's not a browser license it just doesn't allow distributing the font as part of a software package. Fetching it via api with license key in the request is fine.

Re: packaging fonts into module

Posted: Wed Sep 14, 2022 4:50 pm
by Vadi
See if the filename ends on .ttf or .otf. Otherwise, compare getAvailableFonts() before and after package loading?

Re: packaging fonts into module

Posted: Wed Sep 14, 2022 5:55 pm
by neve
It is a .ttf and getAvailableFonts() is how I was checking for it. I see all of my system fonts, and it shows up there if I add it to my system globally. It's not just this font either, I can't get any to become available by putting them in the mpackage zip.

Re: packaging fonts into module

Posted: Wed Sep 14, 2022 6:49 pm
by Vadi
Alright, those were my off the top of the head ideas - anything else would require a deeper dive to see what's going wrong here.

Re: packaging fonts into module

Posted: Wed Sep 14, 2022 7:01 pm
by neve
Yeah I kinda figured, thanks for the help. I think that is going to be the final nail for mudlet for this project then unfortunately. It doesn't support screenreaders and it doesn't support custom fonts except in this specific inflexible way that also doesn't work. You really don't have any other visually impaired users of this thing or?

Re: packaging fonts into module

Posted: Wed Sep 14, 2022 7:19 pm
by demonnic
Actually, screenreader support is in the PTB version and should be included in the Mudlet 4.17.0 release, barring major catastrophes in testing between now and then.

I just tested and my Mudlet 4.16.0 is loading several test ttf files into the list of available fonts on profile load. It may just require closing and restarting the profile after downloading the font the first time. What OS are you using, perhaps there's an issue on one OS in particular I'm not seeing? Running on Windows 10 right now.

Re: packaging fonts into module

Posted: Thu Sep 15, 2022 5:24 am
by Vadi
Custom fonts do work, others are using them successfully.