Subject: [Gimp-gui] Are fontconfig aliases meaningful?

From: Jehan <[email-masked]>
Date: Sun, 25 Oct 2015 19:00:46 +0100

Hi,

In our list of fonts, we can see the fonts Sans-serif, Serif and 
Monospace. These are actually aliases by fontconfig. There are no fonts 
actually called "Sans-serif", nor "Serif" or "Monospace".

When you hit "Sans-serif" in the list of font in GIMP, some other will 
be used, most likely depending on which computer you are on (not even 
just the operating system, it will depend on what you have installed 
too, etc.). For instance, on my system, the command "fc-match -s 
Sans-serif" tells me that "DejaVu Sans" will be used.

This is very useful for UIs, where you don't know what font exactly 
every person who will use your website/software will use, so you just 
specify such an alias instead as a default (which the user can later 
customize on OS, Desktop or software level).

For GIMP images, it means that when you select "Sans", you don't even 
know which font is actually behind. Worse if you send a XCF to someone, 
on text edit, the font will change (if another is used under the hood 
for the other person).
I definitely prefer to know which font is actually used (and on file 
sharing, if the other does not have the right font, get a message 
telling you the font name which is missing so that I can search and 
install it).

In my opinion, these alias could nearly disappear except I still see 
some usage of aliases. Let's say I want to create a mockup of UI, I may 
want to just use whatever "Sans-serif" is on my system.

Solution could be that when I click an alias, it actually change 
directly into the actual font. I want the information of which actual 
font was used stored in the XCF. Not only for sharing, but even if I 
ever want to edit the file later on another computer.

Any opinion on this?

Jehan

---

From: Liam R E Quin <[email-masked]>
Date: Mon, 26 Oct 2015 04:53:58 +0900

> on text edit, the font will change (if another is used under the hood 

This means the aliased fonts aren't suitable for interchange - but fc-list here produces over 7,000 entries, and I can't assume that someone else will have, say, MVP Celestia installed on their system.

The aliases are great when you want a font that matches the UI, and they are useful for defaults e.g. in scripts where you've no idea what fants the user will have.

You can also use them to construct fonts - e.g. I make a version of Courier that's horizontally condensed, although they don't seem to work in gimp.

> telling you the font name which is missing so that I can search and 
Better might be a dialogue a la Quark Express, that shows which fonts are used with a project. An option to keep fonts in a per-project directory (folder) and activate them only when the project is open would be awesome.

> directly into the actual font.

But if I save the file, change theme, open the file again, maybe I now want the current theme font to be used? I'm not sure, I think it'd be OK either way.

> I want the information of which actual 
It would help if Image->Information had a "fonts" tab.

When we add opentype feature support this will become more important and the font chooser may need revamping too (e.g. "I want a font with a ct ligature").

Liam

-- 
Liam Quin - XML Activity Lead, W3C, http://www.w3.org/People/Quin/
Pictures from old books: http://fromoldbooks.org/

---

From: Jehan <[email-masked]>
Date: Mon, 26 Oct 2015 01:48:14 +0100

Hi,

On 2015-10-25 20:53, Liam R E Quin wrote:
> This means the aliased fonts aren't suitable for interchange - but
> fc-list here produces over 7,000 entries, and I can't assume that
> someone else will have, say, MVP Celestia installed on their system.

No but at least you can output an error. This is something which I have 
added in GIMP: when you try to edit a text and you happen not to have 
the right font, the font name is red and hovering it, it tells you what 
was the original font. This allows users to have the "information" which 
helps them search the right font.
With "Sans-serif", you'll just never get an error (everybody has a 
Sans-serif font, simply not the same as your neighbour) and you are 
ignorant of the problem which will occurs the second you will start 
editing your text.

> The aliases are great when you want a font that matches the UI, and
> they are useful for defaults e.g. in scripts where you've no idea what
> fants the user will have.

I agree. This is why I think the usage of alias should not be banned. 
Simply we should make clear to users which is the actual font used, in 
my opinion, and this knowledge should also be in the XCF (not the 
alias).

> You can also use them to construct fonts - e.g. I make a version of
> Courier that's horizontally condensed, although they don't seem to
> work in gimp.

You mean aliases that you built yourself? Actually we don't "discover" 
aliases from GIMP. We manually and explicitly added the 3 aliases. Do 
you know if there is an API to discover all existing aliases?

Of course, this creates a clear problem of interchange here.

> Better might be a dialogue a la Quark Express, that shows which fonts
> are used with a project. An option to keep fonts in a per-project
> directory (folder) and activate them only when the project is open
> would be awesome.

Could you explain this? I don't really understand. Is this dialog and 
the option 2 different features?

> But if I save the file, change theme, open the file again, maybe I now
> want the current theme font to be used? I'm not sure, I think it'd be
> OK either way.

The thing is that when you reopen the file, the text is *not* 
re-rendered. So right now you can perfectly open a XCF file for which 
you don't have the fonts, do some edits on the image (even transform the 
text layers without touching the contents) and re-export, all this 
without ever installing the fonts. Which I think is a very cool and 
useful behaviour (it saved me a lot of time many times when I just 
wanted to touch non-text layers in XCF made by someone else, or with 
fonts I didn't have anymore). A text layer is re-rendered only when you 
start editing it (and only then not having the right font becomes a 
problem), which actually makes a lot of sense.
This prevents common issues like in other software when you open a file 
someone sent you and it looks horribly broken at import.

So what you say would not even work that easily. You'd have to open the 
file, then try to edit every text to force them changing to the locale 
font for a given alias.

> It would help if Image->Information had a "fonts" tab.

Yes that's a good idea. Actually such a tab could even have some feature 
like changing all texts with a given fonts into another font in one 
click! This would solve your idea of UI mockups much better than 
"reopening a file after changing a theme".

> When we add opentype feature support this will become more important
> and the font chooser may need revamping too (e.g. "I want a font with
> a ct ligature").

Yes a lot of things need revamping in the font choosing UIs anyway, even 
without opentype!
This topic by itself is a whole huge can of worms!

Jehan