1556 / New font installation?

Nyyrazzilyss
Posts: 334
Joined: Thu Mar 05, 2015 2:53 am

1556 / New font installation?

Post by Nyyrazzilyss » Tue Feb 13, 2018 4:09 pm

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?

User avatar
SlySven
Posts: 892
Joined: Mon Mar 04, 2013 3:40 pm
Location: Deepest Wiltshire, UK
Discord: SlySven#2703

Re: 1556 / New font installation?

Post by SlySven » Tue Feb 13, 2018 9:13 pm

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...

Nyyrazzilyss
Posts: 334
Joined: Thu Mar 05, 2015 2:53 am

Re: 1556 / New font installation?

Post by Nyyrazzilyss » Tue Feb 13, 2018 9:43 pm

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.

User avatar
SlySven
Posts: 892
Joined: Mon Mar 04, 2013 3:40 pm
Location: Deepest Wiltshire, UK
Discord: SlySven#2703

Re: 1556 / New font installation?

Post by SlySven » Wed Feb 14, 2018 12:01 am

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)...

Nyyrazzilyss
Posts: 334
Joined: Thu Mar 05, 2015 2:53 am

Re: 1556 / New font installation?

Post by Nyyrazzilyss » Wed Feb 14, 2018 12:49 am

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.

Nyyrazzilyss
Posts: 334
Joined: Thu Mar 05, 2015 2:53 am

Re: 1556 / New font installation?

Post by Nyyrazzilyss » Wed Feb 14, 2018 12:59 am

This is with the expectation that the (non-monospace) font was being accessed through css.

User avatar
SlySven
Posts: 892
Joined: Mon Mar 04, 2013 3:40 pm
Location: Deepest Wiltshire, UK
Discord: SlySven#2703

Re: 1556 / New font installation?

Post by SlySven » Wed Feb 14, 2018 1:03 am

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...

Nyyrazzilyss
Posts: 334
Joined: Thu Mar 05, 2015 2:53 am

Re: 1556 / New font installation?

Post by Nyyrazzilyss » Wed Feb 14, 2018 2:11 am

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.

User avatar
SlySven
Posts: 892
Joined: Mon Mar 04, 2013 3:40 pm
Location: Deepest Wiltshire, UK
Discord: SlySven#2703

Re: 1556 / New font installation?

Post by SlySven » Wed Feb 14, 2018 11:52 am

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 .

User avatar
Vadi
Posts: 4608
Joined: Sat Mar 14, 2009 3:13 pm

Re: 1556 / New font installation?

Post by Vadi » Thu Feb 15, 2018 10:31 am

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.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests