Page 1 of 3

1556 / New font installation?

Posted: Tue Feb 13, 2018 4:09 pm
by Nyyrazzilyss
A question in regards to https://github.com/Mudlet/Mudlet/pull/1556

BugFix: allow font-load from sub-directory w/versions without bundled fonts

Am I right to guess that this will allow me to include a .ttf file with my script, copy it to a location that is writable by the script, and then be able to subsequently use that font?

Re: 1556 / New font installation?

Posted: Tue Feb 13, 2018 9:13 pm
by SlySven
You can already do that if you put the font into the fonts sub-directory alongside the profiles on, so will be: getMudletHomeDir() .. "/../../fonts" or perhaps a directory a level down specific to the font file or files (.otf or .ttf extensions) concerned.

The need for the bug fix was because it is possible now to not include the Bitstream Vera and Ubuntu fonts in the executable {some platform packagers do not need them as they already include them in the system's fonts} - and I had (unintentionally) disabled the code that loads in any fonts in that part of the file-system, specially for the private use by Mudlet only, for versions that do not include those two sets of fonts - even though it is still needed then...

Re: 1556 / New font installation?

Posted: Tue Feb 13, 2018 9:43 pm
by Nyyrazzilyss
Just attempted: I copied the desired .ttf file into the fonts directory with all the other .ttf files. Restarted mudlet, checked settings/main display, and the desired new font wasn't listed as being available. Window/3.7.1 : Not sure if i'm doing something wrong, or it just doesn't work either.

Re: 1556 / New font installation?

Posted: Wed Feb 14, 2018 12:01 am
by SlySven
Ermm, yeah, I've recently started to wonder about it as well because I am trying to find a good font to use for both Latin1 and CJK mixed usage {I'm trying to get a reasonable display for a MUD that uses both ASCII type characters and (simplified) Chinese ones - and they tend to have different widths} and I had tried dropping in some fonts to try.

I think you will need to ensure that the fonts are monospaced as the core Mudlet code is predicated currently (but I think I will have to allow the requirement to be droppable on demand) around using fonts that the Qt libraries tell it have a fixed font pitch (and the font selection combo-box on the "Main" tab is configured to only show such monospaced fonts)...

Re: 1556 / New font installation?

Posted: Wed Feb 14, 2018 12:49 am
by Nyyrazzilyss
Thanks, that's what it was - mono space requirement.

I downloaded a monospace ttf, copied it to the fonts folder, and it was visible and usable after mudlet restart.

Of course, that doesn't quite meet what I was looking for :( I was looking to use a non-monospace font to rebuild my gui buttons etc realtime so as to not be using pre-generated .png files.

Re: 1556 / New font installation?

Posted: Wed Feb 14, 2018 12:59 am
by Nyyrazzilyss
This is with the expectation that the (non-monospace) font was being accessed through css.

Re: 1556 / New font installation?

Posted: Wed Feb 14, 2018 1:03 am
by SlySven
Well any font files in there will get registered and can be used, I think, it is just that you can't select it for the main/sub-console/user windows - I do not think the monospace provision is a requirement for labels that you can specify the font for or something that the CSS gets wrangled on...

Re: 1556 / New font installation?

Posted: Wed Feb 14, 2018 2:11 am
by Nyyrazzilyss
Thanks, worked!

I'll play around a bit with it, but copying the font into the 'fonts' folder was good enough. Despite it not being monospace it was still loaded/ just not listed, and was accessible with css.

Re: 1556 / New font installation?

Posted: Wed Feb 14, 2018 11:52 am
by SlySven
Well that sounds like what I expected - so great. Just remember that users of versions since we introduced the Ubuntu font(s) in the bundle who had the environmental variable WITH_FONTS defined to "NO" during the build will NOT see those fonts until the next version is out - or they build from the current or later development branch from https://github.com/mudlet/mudlet.git .

Re: 1556 / New font installation?

Posted: Thu Feb 15, 2018 10:31 am
by Vadi
This is a hacky way to install fonts and error-prone. I'd like to add a proper solution to using custom fonts in Mudlet with packages in the near future.