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?
1556 / New font installation?
- SlySven
- Posts: 1023
- Joined: Mon Mar 04, 2013 3:40 pm
- Location: Deepest Wiltshire, UK
- Discord: SlySven#2703
Re: 1556 / New font installation?
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...
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...
-
- Posts: 334
- Joined: Thu Mar 05, 2015 2:53 am
Re: 1556 / New font installation?
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.
- SlySven
- Posts: 1023
- Joined: Mon Mar 04, 2013 3:40 pm
- Location: Deepest Wiltshire, UK
- Discord: SlySven#2703
Re: 1556 / New font installation?
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)...
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)...
-
- Posts: 334
- Joined: Thu Mar 05, 2015 2:53 am
Re: 1556 / New font installation?
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.
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.
-
- Posts: 334
- Joined: Thu Mar 05, 2015 2:53 am
Re: 1556 / New font installation?
This is with the expectation that the (non-monospace) font was being accessed through css.
- SlySven
- Posts: 1023
- Joined: Mon Mar 04, 2013 3:40 pm
- Location: Deepest Wiltshire, UK
- Discord: SlySven#2703
Re: 1556 / New font installation?
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...
-
- Posts: 334
- Joined: Thu Mar 05, 2015 2:53 am
Re: 1556 / New font installation?
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.
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.
- SlySven
- Posts: 1023
- Joined: Mon Mar 04, 2013 3:40 pm
- Location: Deepest Wiltshire, UK
- Discord: SlySven#2703
Re: 1556 / New font installation?
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?
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.