You are not logged in.

#1 2012-09-23 22:55:12

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,198

Re: fontconfig upgrade & infinality

bohoomil wrote:
cfr wrote:

Is this going to make it to AUR or is the code now on GitHub only? (And if so, where can I find a link?)

You will find a direct link to the fontconfig repository in my signature. I wasn't going to create a package, but in case anyone needs / prefers one, here you go: http://db.tt/UrEjk4Ie.

I haven't actually installed this yet because I decided to fiddle a little first. I built it and examined the files it would install but it seemed understandably customised for a set up other than my own so I decided instead to use the fixes it contains to try to deal with the errors I'm seeing.

So I cloned the linux style to create a custom set up. I tweaked a few general things. Then I essentially applied bohoomil's fixes to two of the affected files (60-*). That reduced the errors so I turned to 62-* and 80-* which were the other files which seemed to be giving me errors. However, I got kind of frustrated and wondered if there was another way.

I now have a question. Here is the fixed version of 62-tt-monospace-rendering.conf for the infinality style supplied by bohoomil:

<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>

        <!-- OVERRIDE SETTINGS -->
        <!-- Monochrome BCI for these fonts (circa Windows 98) -->
        <!-- This will make them look like crisp bitmap fonts. -->
        <!-- This should only be used by fonts that contain good TrueType
                         instruction.s -->

        <match target="font">
                <test name="family">
                        <string>Andale Mono</string>
                </test>
                <test name="bitmap_monospace">
                        <bool>true</bool>
                </test>
                <edit name="hinting" mode="assign">
                        <bool>true</bool>
                </edit>
                <edit name="autohint" mode="assign">
                        <bool>false</bool>
                </edit>
                <edit name="antialias" mode="assign">
                        <bool>false</bool>
                </edit>
                <edit name="hintstyle" mode="assign">
                        <const>hintfull</const>
                </edit>
                <edit name="embeddedbitmap" mode="assign">
                        <bool>true</bool>
                </edit>
        </match>

        <match target="font">
                <test name="family">
                        <string>Anonymous Pro</string>
                </test>
                <test name="bitmap_monospace">
                        <bool>true</bool>
                </test>
                <edit name="hinting" mode="assign">
                        <bool>true</bool>
                </edit>
                <edit name="autohint" mode="assign">
                        <bool>false</bool>
                </edit>
                <edit name="antialias" mode="assign">
                        <bool>false</bool>
                </edit>
                <edit name="hintstyle" mode="assign">
                        <const>hintfull</const>
                </edit>
                <edit name="embeddedbitmap" mode="assign">
                        <bool>true</bool>
                </edit>
        </match>

        <match target="font">
                <test name="family">
                        <string>APL385 Unicode</string>
                </test>
                <test name="bitmap_monospace">
                        <bool>true</bool>
                </test>
                <edit name="hinting" mode="assign">
                        <bool>true</bool>
                </edit>
                <edit name="autohint" mode="assign">
                        <bool>false</bool>
                </edit>
                <edit name="antialias" mode="assign">
                        <bool>false</bool>
                </edit>
                <edit name="hintstyle" mode="assign">
                        <const>hintfull</const>
                </edit>
                <edit name="embeddedbitmap" mode="assign">
                        <bool>true</bool>
                </edit>
        </match>

        <match target="font">
                <test name="family">
                        <string>Bitstream Vera Sans Mono</string>
                </test>
                <test name="bitmap_monospace">
                        <bool>true</bool>
                </test>
                <edit name="hinting" mode="assign">
                        <bool>true</bool>
                </edit>
                <edit name="autohint" mode="assign">
                        <bool>false</bool>
                </edit>
                <edit name="antialias" mode="assign">
                        <bool>false</bool>
                </edit>
                <edit name="hintstyle" mode="assign">
                        <const>hintfull</const>
                </edit>
                <edit name="embeddedbitmap" mode="assign">
                        <bool>true</bool>
                </edit>
        </match>

        <match target="font">
                <test name="family">
                        <string>Courier New</string>
                </test>
                <test name="bitmap_monospace">
                        <bool>true</bool>
                </test>
                <edit name="hinting" mode="assign">
                        <bool>true</bool>
                </edit>
                <edit name="autohint" mode="assign">
                        <bool>false</bool>
                </edit>
                <edit name="antialias" mode="assign">
                        <bool>false</bool>
                </edit>
                <edit name="hintstyle" mode="assign">
                        <const>hintfull</const>
                </edit>
                <edit name="embeddedbitmap" mode="assign">
                        <bool>true</bool>
                </edit>
        </match>

        <match target="font">
                <test name="family">
                        <string>DejaVu Sans Mono</string>
                </test>
                <test name="bitmap_monospace">
                        <bool>true</bool>
                </test>
                <edit name="hinting" mode="assign">
                        <bool>true</bool>
                </edit>
                <edit name="autohint" mode="assign">
                        <bool>false</bool>
                </edit>
                <edit name="antialias" mode="assign">
                        <bool>false</bool>
                </edit>
                <edit name="hintstyle" mode="assign">
                        <const>hintfull</const>
                </edit>
                <edit name="embeddedbitmap" mode="assign">
                        <bool>true</bool>
                </edit>
        </match>

        <match target="font">
                <test name="family">
                        <string>Envy Code R</string>
                </test>
                <test name="bitmap_monospace">
                        <bool>true</bool>
                </test>
                <edit name="hinting" mode="assign">
                        <bool>true</bool>
                </edit>
                <edit name="autohint" mode="assign">
                        <bool>false</bool>
                </edit>
                <edit name="antialias" mode="assign">
                        <bool>false</bool>
                </edit>
                <edit name="hintstyle" mode="assign">
                        <const>hintfull</const>
                </edit>
                <edit name="embeddedbitmap" mode="assign">
                        <bool>true</bool>
                </edit>
        </match>

        <match target="font">
                <test name="family">
                        <string>Essential PragmataPro</string>
                </test>
                <test name="bitmap_monospace">
                        <bool>true</bool>
                </test>
                <edit name="hinting" mode="assign">
                        <bool>true</bool>
                </edit>
                <edit name="autohint" mode="assign">
                        <bool>false</bool>
                </edit>
                <edit name="antialias" mode="assign">
                        <bool>false</bool>
                </edit>
                <edit name="hintstyle" mode="assign">
                        <const>hintfull</const>
                </edit>
                <edit name="embeddedbitmap" mode="assign">
                        <bool>true</bool>
                </edit>
        </match>

        <match target="font">
                <test name="family">
                        <string>Inconsolata</string>
                </test>
                <test name="bitmap_monospace">
                        <bool>true</bool>
                </test>
                <edit name="hinting" mode="assign">
                        <bool>true</bool>
                </edit>
                <edit name="autohint" mode="assign">
                        <bool>false</bool>
                </edit>
                <edit name="antialias" mode="assign">
                        <bool>false</bool>
                </edit>
                <edit name="hintstyle" mode="assign">
                        <const>hintfull</const>
                </edit>
                <edit name="embeddedbitmap" mode="assign">
                        <bool>true</bool>
                </edit>
        </match>

        <match target="font">
                <test name="family">
                        <string>Liberation Mono</string>
                </test>
                <test name="bitmap_monospace">
                        <bool>true</bool>
                </test>
                <edit name="hinting" mode="assign">
                        <bool>true</bool>
                </edit>
                <edit name="autohint" mode="assign">
                        <bool>false</bool>
                </edit>
                <edit name="antialias" mode="assign">
                        <bool>false</bool>
                </edit>
                <edit name="hintstyle" mode="assign">
                        <const>hintfull</const>
                </edit>
                <edit name="embeddedbitmap" mode="assign">
                        <bool>true</bool>
                </edit>
        </match>

        <match target="font">
                <test name="family">
                        <string>Lucida Console</string>
                </test>
                <test name="bitmap_monospace">
                        <bool>true</bool>
                </test>
                <edit name="hinting" mode="assign">
                        <bool>true</bool>
                </edit>
                <edit name="autohint" mode="assign">
                        <bool>false</bool>
                </edit>
                <edit name="antialias" mode="assign">
                        <bool>false</bool>
                </edit>
                <edit name="hintstyle" mode="assign">
                        <const>hintfull</const>
                </edit>
                <edit name="embeddedbitmap" mode="assign">
                        <bool>true</bool>
                </edit>
        </match>

        <match target="font">
                <test name="family">
                        <string>Lucida Sans Typewriter</string>
                </test>
                <test name="bitmap_monospace">
                        <bool>true</bool>
                </test>
                <edit name="hinting" mode="assign">
                        <bool>true</bool>
                </edit>
                <edit name="autohint" mode="assign">
                        <bool>false</bool>
                </edit>
                <edit name="antialias" mode="assign">
                        <bool>false</bool>
                </edit>
                <edit name="hintstyle" mode="assign">
                        <const>hintfull</const>
                </edit>
                <edit name="embeddedbitmap" mode="assign">
                        <bool>true</bool>
                </edit>
        </match>

        <match target="font">
                <test name="family">
                        <string>Łucznik 1303</string>
                </test>
                <test name="bitmap_monospace">
                        <bool>true</bool>
                </test>
                <edit name="hinting" mode="assign">
                        <bool>true</bool>
                </edit>
                <edit name="autohint" mode="assign">
                        <bool>false</bool>
                </edit>
                <edit name="antialias" mode="assign">
                        <bool>false</bool>
                </edit>
                <edit name="hintstyle" mode="assign">
                        <const>hintfull</const>
                </edit>
                <edit name="embeddedbitmap" mode="assign">
                        <bool>true</bool>
                </edit>
        </match>

        <match target="font">
                <test name="family">
                        <string>Łucznik 1303 Plus</string>
                </test>
                <test name="bitmap_monospace">
                        <bool>true</bool>
                </test>
                <edit name="hinting" mode="assign">
                        <bool>true</bool>
                </edit>
                <edit name="autohint" mode="assign">
                        <bool>false</bool>
                </edit>
                <edit name="antialias" mode="assign">
                        <bool>false</bool>
                </edit>
                <edit name="hintstyle" mode="assign">
                        <const>hintfull</const>
                </edit>
                <edit name="embeddedbitmap" mode="assign">
                        <bool>true</bool>
                </edit>
        </match>

        <match target="font">
                <test name="family">
                        <string>Meslo LG</string>
                </test>
                <test name="bitmap_monospace">
                        <bool>true</bool>
                </test>
                <edit name="hinting" mode="assign">
                        <bool>true</bool>
                </edit>
                <edit name="autohint" mode="assign">
                        <bool>false</bool>
                </edit>
                <edit name="antialias" mode="assign">
                        <bool>false</bool>
                </edit>
                <edit name="hintstyle" mode="assign">
                        <const>hintfull</const>
                </edit>
                <edit name="embeddedbitmap" mode="assign">
                        <bool>true</bool>
                </edit>
        </match>

        <match target="font">
                <test name="family">
                        <string>Menlo</string>
                </test>
                <test name="bitmap_monospace">
                        <bool>true</bool>
                </test>
                <edit name="hinting" mode="assign">
                        <bool>true</bool>
                </edit>
                <edit name="autohint" mode="assign">
                        <bool>false</bool>
                </edit>
                <edit name="antialias" mode="assign">
                        <bool>false</bool>
                </edit>
                <edit name="hintstyle" mode="assign">
                        <const>hintfull</const>
                </edit>
                <edit name="embeddedbitmap" mode="assign">
                        <bool>true</bool>
                </edit>
        </match>

        <match target="font">
                <test name="family">
                        <string>Monaco</string>
                </test>
                <test name="bitmap_monospace">
                        <bool>true</bool>
                </test>
                <edit name="hinting" mode="assign">
                        <bool>true</bool>
                </edit>
                <edit name="autohint" mode="assign">
                        <bool>false</bool>
                </edit>
                <edit name="antialias" mode="assign">
                        <bool>false</bool>
                </edit>
                <edit name="hintstyle" mode="assign">
                        <const>hintfull</const>
                </edit>
                <edit name="embeddedbitmap" mode="assign">
                        <bool>true</bool>
                </edit>
        </match>

        <match target="font">
                <test name="family">
                        <string>Oxygen Mono</string>
                </test>
                <test name="bitmap_monospace">
                        <bool>true</bool>
                </test>
                <edit name="hinting" mode="assign">
                        <bool>true</bool>
                </edit>
                <edit name="autohint" mode="assign">
                        <bool>false</bool>
                </edit>
                <edit name="antialias" mode="assign">
                        <bool>false</bool>
                </edit>
                <edit name="hintstyle" mode="assign">
                        <const>hintfull</const>
                </edit>
                <edit name="embeddedbitmap" mode="assign">
                        <bool>true</bool>
                </edit>
        </match>

        <match target="font">
                <test name="family">
                        <string>Pragmata</string>
                </test>
                <test name="bitmap_monospace">
                        <bool>true</bool>
                </test>
                <edit name="hinting" mode="assign">
                        <bool>true</bool>
                </edit>
                <edit name="autohint" mode="assign">
                        <bool>false</bool>
                </edit>
                <edit name="antialias" mode="assign">
                        <bool>false</bool>
                </edit>
                <edit name="hintstyle" mode="assign">
                        <const>hintfull</const>
                </edit>
                <edit name="embeddedbitmap" mode="assign">
                        <bool>true</bool>
                </edit>
        </match>

        <match target="font">
                <test name="family">
                        <string>PragmataPro</string>
                </test>
                <test name="bitmap_monospace">
                        <bool>true</bool>
                </test>
                <edit name="hinting" mode="assign">
                        <bool>true</bool>
                </edit>
                <edit name="autohint" mode="assign">
                        <bool>false</bool>
                </edit>
                <edit name="antialias" mode="assign">
                        <bool>false</bool>
                </edit>
                <edit name="hintstyle" mode="assign">
                        <const>hintfull</const>
                </edit>
                <edit name="embeddedbitmap" mode="assign">
                        <bool>true</bool>
                </edit>
        </match>

        <match target="font">
                <test name="family">
                        <string>Ubuntu Mono</string>
                </test>
                <test name="bitmap_monospace">
                        <bool>true</bool>
                </test>
                <edit name="hinting" mode="assign">
                        <bool>true</bool>
                </edit>
                <edit name="autohint" mode="assign">
                        <bool>false</bool>
                </edit>
                <edit name="antialias" mode="assign">
                        <bool>false</bool>
                </edit>
                <edit name="hintstyle" mode="assign">
                        <const>hintfull</const>
                </edit>
                <edit name="embeddedbitmap" mode="assign">
                        <bool>true</bool>
                </edit>
        </match>

</fontconfig>

and here is my current version of 62-tt-monospace-rendering.conf which is adapted from the default for the linux style:

<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>

        <!-- ##Style: common -->

        <!-- OVERRIDE SETTINGS -->
        <!-- Monochrome BCI for these fonts (circa Windows 98) -->
        <!-- This will make them look like crisp bitmap fonts. -->
        <!-- This should only be used by fonts that contain good TrueType instructions -->
        <match target="font">
                <test name="family">
                        <or>
                                <string>Andale Mono</string>
                                <string>Anonymous Pro</string>
                                <string>Bitstream Vera Sans Mono</string>
                                <string>Courier New</string>
                                <string>DejaVu Sans Mono</string>
                                <string>Essential PragmataPro</string>
                                <string>Inconsolata</string>
                                <string>Liberation Mono</string>
                                <string>Lucida Console</string>
                                <string>Lucida Sans Typewriter</string>
                                <string>Monaco</string>
                                <string>Pragmata</string>
                                <string>PragmataPro</string>
                                <string>Ubuntu Mono</string>
                        </or>
                </test>
                <test name="bitmap_monospace">
                        <bool>true</bool>
                </test>
                <edit name="hinting" mode="assign">
                        <bool>true</bool>
                </edit>
                <edit name="autohint" mode="assign">
                        <bool>false</bool>
                </edit>
                <edit name="antialias" mode="assign">
                        <bool>false</bool>
                </edit>
                <edit name="hintstyle" mode="assign">
                        <const>hintfull</const>
                </edit>
                <edit name="embeddedbitmap" mode="assign">
                        <bool>true</bool>
                </edit>
        </match>

</fontconfig>

Now obviously this can't possibly be right else everybody would have used it. However, the man page isn't very clear on how to use <or> (I know what 'boolean' means but what is 'bitwise'?). What would this code actually do (and fail to do)? Does it just have no effect? (I haven't yet figured out the best way to check the effect changes have beyond which font will be matched for a given name.)

EDIT: An answer which let me know how to figure out how fontconfig will actually display a given font would be even better. Then I could (hopefully) figure this out for myself. I want something like fc-effect!

Last edited by cfr (2012-09-23 23:22:17)


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#2 2012-09-24 01:27:58

bohoomil
Banned
Registered: 2010-09-04
Posts: 2,377
Website

Re: fontconfig upgrade & infinality

cfr wrote:

Here is the fixed version of 62-tt-monospace-rendering.conf for the infinality style supplied by bohoomil:

It's ugly. I guess it would better look like this:

<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>

<match target="font">
	<test name="family">
		<string>Andale Mono</string>
	</test>
	<test name="bitmap_monospace">
		<bool>true</bool>
	</test>
	<edit name="font_type" mode="assign">
		<string>MONO GROUP</string>
	</edit>
</match>

## [ repeat for all the fonts you want to
##   group under MONO GROUP label ]

<match target="font">
	<test name="font_type">
		<string>MONO GROUP</string>
	</test>
	<edit name="hinting" mode="assign">
		<bool>true</bool>
	</edit>
	<edit name="autohint" mode="assign">
		<bool>false</bool>
	</edit>
	<edit name="antialias" mode="assign">
		<bool>false</bool>
	</edit>
	<edit name="hintstyle" mode="assign">
		<const>hintfull</const>
	</edit>
	<edit name="embeddedbitmap" mode="assign">
		<bool>true</bool>
	</edit>
</match>
</fontconfig>

I'm afraid that grouping the fonts the way you would like to do this is the old way, which is now deprecated. (Correct me, please, if I am wrong.) The old way worked basically like this:

[for a font family that equals]
   [Font 1]
     or
   [Font 2]
     or
   [Font 3]
[apply the following settings]
   [Set 1]
     and
   [Set 2]
     and
   [Set3]

Now that such a multiple test as in [for a font family] part is not available any more, the only way I can think of (and the only one that works) is the one above. If there's a way to do this better, I'd love to know myself.

Edit: a little side note. I think we should not continue this very specific discussion here. Instead, please create a new topic and maybe a moderator can extract all the relevant posts and transfer them to it. It has already gone beyond the limits of a simple quick tip which my initial post was actually meant to be. I'm sorry for inconvenience.

** mod edit: good idea, I'll split and merge when the new thread is opened...

Last edited by bohoomil (2012-09-24 10:18:31)


:: Registered Linux User No. 223384

:: github
:: infinality-bundle+fonts: good looking fonts made easy

Offline

#3 2012-09-25 23:03:30

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,198

fontconfig upgrade & infinality

This is the thread split from a more general discussion in the GNU/Linux forum. If this is not the most appropriate place for this thread, please do move it as I wasn't quite sure what fit best.

The original thread was here: https://bbs.archlinux.org/viewtopic.php?id=65318&p=36.

The first really egregious post was mine: https://bbs.archlinux.org/viewtopic.php … 2#p1165642. Apologies for the inconvenience. I wanted it to follow-up the earlier posts and so didn't like to just break off new... but, well... it wasn't the best fit.

This is the post in which splitting the thread is suggested and endorsed by a mod. who promises to move the posts when this thread is opened: https://bbs.archlinux.org/viewtopic.php … 6#p1165666. Thanks very much for that.


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#4 2012-09-25 23:11:10

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,198

Re: fontconfig upgrade & infinality

@bohoomil,

Is the problem with my suggestion that it doesn't have the expected effect?

It doesn't give me errors so it certainly doesn't fail in quite the same way as the original. But that does not, of course, mean that it is actually having the intended effect on the way fonts are rendered i.e. it might just not do what is wanted despite having acceptable syntax. I'm assuming that fontconfig finds the syntax acceptable because it doesn't spew errors as it was before.

I guess just trying to understand this a bit better, what *does* the file I suggested do if it doesn't do what's wanted? I really wish there was a good way to see exactly which options would be applied to a font when rendered. (A bit like fc-match but showing the final results for hinting etc. However, I can't seem to find such a useful tool. sad)


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#5 2012-09-25 23:17:32

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: fontconfig upgrade & infinality

I'm not sure if I understood, do you want a font previewer?
https://bbs.archlinux.org/viewtopic.php?id=149112

Offline

#6 2012-09-25 23:25:39

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,198

Re: fontconfig upgrade & infinality

karol wrote:

I'm not sure if I understood, do you want a font previewer?

No. I want an option for fontconfig (or another command line tool) which will tell me exactly how fontconfig will render a given font.

So right now, I can do, say, fc-match "DejaVu Sans" and it will tell me the font file and name of the font it would actually use if an application asked it for "DejaVu Sans".

I want to be able to do, say, fc-render --pointsize 11 "DejaVu Sans" and have fontconfig tell me exactly how it would render that font. For example, will it apply (BCI) hinting? autohinting? hintfull? hintslight? Will it use sub-pixel rendering and, if so, which kind? Will it use antialiases? Will it perform a transformation matrix (to fake an oblique font) or try to fake bold? And so on.

The reason I'd like this is that I personally find fontconfig configuration files quite difficult to interpret and a combination of them is more difficult still. I'd like to be able to easily check whether a given set up will do what I think it will do. I don't want to have to render the fonts and then examine them in order to determine this. (Besides, that just introduces another layer where things might go wrong in the previewer itself. I want to know what fontconfig is _trying_ to do with a font, given a particular configuration. I also don't want to have to visually determine the differences.)

The left hand side of the preview for this tool is the kind of thing I'd like. Thanks very much for pointing me towards this. I really would prefer a CLI tool but failing that, this looks very promising. (A font previewer would probably be useful, too, for other purposes.)

Last edited by cfr (2012-09-25 23:33:08)


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#7 2012-09-25 23:34:38

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 7,362

Re: fontconfig upgrade & infinality

Mod-merged.

EDIT: yes, that's the correct way to use the report button, by the way smile

Last edited by ngoonee (2012-09-25 23:35:29)


Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

#8 2012-09-26 03:07:40

bohoomil
Banned
Registered: 2010-09-04
Posts: 2,377
Website

Re: fontconfig upgrade & infinality

Would something like this:

$ fc-match -v "DejaVu Sans" | egrep 'family|hint'
        family: "DejaVu Sans"(s)
        familylang: "en"(s)
        hintstyle: 3(i)(w)
        hinting: FcTrue(w)
        autohint: FcFalse(w)
        force_autohint: FcFalse(w)

do the job?

Edit: btw, you can specify size / weight of a font in the usual way, e.g. "DejaVu Sans:size=8".

Last edited by bohoomil (2012-09-26 03:10:52)


:: Registered Linux User No. 223384

:: github
:: infinality-bundle+fonts: good looking fonts made easy

Offline

#9 2012-09-26 23:11:12

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,198

Re: fontconfig upgrade & infinality

Thanks to both of you.

I just tried grip but it doesn't quite do what I want. It seems to list overall infinality fontconfig settings but not to tell me how fontconfig will treat a particular font.

@bohoomil,
That looks very promising. I thought I'd tried this but I think I used fc-query and got results that seemed to just concern the font file and not necessarily how the configuration would affect its rendering. I also did not realise that was the "usual way" to specify the size so that is enormously helpful (and seems to work for other attributes, too).

Now I just have to figure out the correspondence...


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#10 2012-09-26 23:59:32

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,198

Re: fontconfig upgrade & infinality

OK. The way I'd done it didn't complain but didn't work either.

This is not terribly tidy but I think it is simpler than using the MONO GROUP.  At least, I think it is fewer lines of configuration:

<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>

        <!-- ##Style: common -->

        <!-- OVERRIDE SETTINGS -->
        <!-- Monochrome BCI for these fonts (circa Windows 98) -->
        <!-- This will make them look like crisp bitmap fonts. -->
        <!-- This should only be used by fonts that contain good TrueType instructions -->
        <match target="font">
                <or>
                        <test name="family">
                                <string>Andale Mono</string>
                        </test>
                        <test name="family">
                                <string>Anonymous Pro</string>
                        </test>
                        <test name="family">
                                <string>Bitstream Vera Sans Mono</string>
                        </test>
                        <test name="family">
                                <string>Courier New</string>
                        </test>
                        <test name="family">
                                <string>DejaVu Sans Mono</string>
                        </test>
                        <test name="family">
                                <string>Essential PragmataPro</string>
                        </test>
                        <test name="family">
                                <string>Inconsolata</string>
                        </test>
                        <test name="family">
                                <string>Liberation Mono</string>
                        </test>
                        <test name="family">
                                <string>Lucida Console</string>
                        </test>
                        <test name="family">
                                <string>Lucida Sans Typewriter</string>
                        </test>
                        <test name="family">
                                <string>Monaco</string>
                        </test>
                        <test name="family">
                                <string>Pragmata</string>
                        </test>
                        <test name="family">
                                <string>PragmataPro</string>
                        </test>
                        <test name="family">
                                <string>Ubuntu Mono</string>
                        </test>
                </or>
                <test name="bitmap_monospace">
                        <bool>true</bool>
                </test>
                <edit name="hinting" mode="assign">
                        <bool>true</bool>
                </edit>
                <edit name="autohint" mode="assign">
                        <bool>false</bool>
                </edit>
                <edit name="antialias" mode="assign">
                        <bool>false</bool>
                </edit>
                <edit name="hintstyle" mode="assign">
                        <const>hintfull</const>
                </edit>
                <edit name="embeddedbitmap" mode="assign">
                        <bool>true</bool>
                </edit>
        </match>
        
</fontconfig>

As far as I can tell (and I may well be wrong) this has the intended effect i.e. the same effect as treating each case separately. Still a pain but not quite as bad, maybe?


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#11 2012-09-27 02:44:30

bohoomil
Banned
Registered: 2010-09-04
Posts: 2,377
Website

Re: fontconfig upgrade & infinality

cfr wrote:

... but not quite as bad, maybe?

That's neat, very neat. As soon as I have a few spare minutes, I'll modify the remaining config files and see how they are going to work in the 'new skin'. Thank you very much for sharing the idea!


:: Registered Linux User No. 223384

:: github
:: infinality-bundle+fonts: good looking fonts made easy

Offline

#12 2012-09-27 21:18:01

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,198

Re: fontconfig upgrade & infinality

Having played with it some more, I'm not certain quite what it does though. I managed to produce some impressively hideous results last night and I'm not quite sure why. I look forward to hearing what your expertise makes of it.

But I'm also not sure that it is not just my general lack of understanding of fontconfig getting in the way. (Hence the hope that you'll shed some light on it when you've had a chance to take a look!)

Last edited by cfr (2012-09-27 21:19:58)


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#13 2012-09-29 07:44:05

w0ng
Member
From: Australia
Registered: 2009-06-04
Posts: 88
Website

Re: fontconfig upgrade & infinality

I haven't seen any examples of the <OR> element being used either, so I'm unsure how to test it.

As a note though, the commit that brought this change (http://cgit.freedesktop.org/fontconfig/ … 18d48f4652) recommends the ugly approach of duplicating <match> elements for each font.

The author of infinality is also updating with the ugly approach: https://github.com/Infinality/fontconfi … b8260740d3

Offline

#14 2012-09-29 09:03:26

bohoomil
Banned
Registered: 2010-09-04
Posts: 2,377
Website

Re: fontconfig upgrade & infinality

w0ng wrote:

I haven't seen any examples of the <OR> element being used either, so I'm unsure how to test it.

The method suggested by cfr seems to be working just fine: rendering rules are being applied correctly to the whole group of fonts and no errors appear in the terminal. I'll soon submit the entire set of files needed by Infinality patches so anyone is welcome to test and provide feedback.


:: Registered Linux User No. 223384

:: github
:: infinality-bundle+fonts: good looking fonts made easy

Offline

#15 2012-09-29 10:36:52

bohoomil
Banned
Registered: 2010-09-04
Posts: 2,377
Website

Re: fontconfig upgrade & infinality

OK, as far as I can tell, the method in question works in most cases. The only exception is the overridden mono rendering where I had to use the updated file provided by the Infinality author. (I uploaded the other version as well, with a .bkp suffix, just in case someone is willing to explore it and explain why it won't work as expected.) I also included a slightly modified Infinality settings file for better results.

https://github.com/bohoomil/fontconf


:: Registered Linux User No. 223384

:: github
:: infinality-bundle+fonts: good looking fonts made easy

Offline

#16 2012-09-29 22:38:03

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,198

Re: fontconfig upgrade & infinality

Hmm... I think that's where I ran into weirdness with the linux style, too (with the 62-* files). And it made Firefox unreadable. I wonder why...

That's what made me think I just didn't get it.

Last edited by cfr (2012-09-29 22:38:56)


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#17 2012-09-30 05:50:00

bohoomil
Banned
Registered: 2010-09-04
Posts: 2,377
Website

Re: fontconfig upgrade & infinality

After even more testing I had to go back where I started... The "<or> </or>" switches don't actually group alternatives; when used this way:

<or>
Font 1
Font 2
Font 3
</or>

fonts are incorrectly assigned to a superior category (TT Instructed Font) while preserving rules from the other one one. Since previously it had taken long months before I managed to fine tune Infinality runtime settings and fontconfig rules so that different foundry-specific glyphs would obey as expected, I knew what the final result should be like. What's more, there is one font that serves as a 'barometer' to me: it's Helvetica. When most fonts tend to be less demanding when it comes to occassional inconsistencies in configuration files, Helvetica immediately goes crazy leaving no room for compromise. This time everything went wrong at the same time: incorect height of individual letters (u, x), incorrect rendering of embolden letters (e, E), incorrect letter spacing (i, j, l), etc.

When you read the official fontconfig documentation, you'll find the following example:

<--
	The example of the requirements of OR operator;
	If the 'family' contains 'Courier New' OR 'Courier'
	add 'monospace' as the alternative
-->
<match target="pattern">
	<test name="family" mode="eq">
		<string>Courier New</string>
	</test>
	<edit name="family" mode="prepend">
		<string>monospace</string>
	</edit>
</match>
<match target="pattern">
	<test name="family" mode="eq">
		<string>Courier</string>
	</test>
	<edit name="family" mode="prepend">
		<string>monospace</string>
	</edit>
</match>

You can see that <or> applies to one category (monospace) that may have two specimen (Courier or Courier New). Still, those two entities are technically treated as one and both are supposed to behave the same way. Hence the binary, or boolean nature of the <or> operand.

I hope this makes the mystery a little bit less cryptic. The repo has been already updated so anyone can safely use it in their own setups.

Last edited by bohoomil (2012-09-30 08:42:16)


:: Registered Linux User No. 223384

:: github
:: infinality-bundle+fonts: good looking fonts made easy

Offline

#18 2012-09-30 23:55:28

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,198

Re: fontconfig upgrade & infinality

I see. (Well, I don't really understand fontconfig files at all but I get that it doesn't work.)

I do apologise for leading you up the garden path - albeit inadvertently.


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

Board footer

Powered by FluxBB