LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-23-2015, 03:51 PM   #1
CVAlkan
Member
 
Registered: Nov 2012
Location: Northwest suburbs of Chicago
Distribution: Ubuntu & Mint LTS, Manjaro Rolling; Android
Posts: 244

Rep: Reputation: Disabled
Font matching & FontConfig Foundry Attribute


According to the documentation (man pages and such) for FontConfig, that utility matches fonts using a very specific set of font characteristics that are weighted in the following order: foundry, charset, family, lang, etc. With the advent of “free” fonts over the past decade, I’ve found that many – even most – such fonts have no foundry listed. Since that is the most heavily weighted attribute in the matching process, and since null is never equal to null, the matches returned are sometimes inappropriate, particularly when attempting to use languages that have different character sets: Even when I have a font that matches in style, weight, etc. FontConfig doesn’t always provide what is the most obvious choice (to a human anyway).

Is there some way to “correct” for this without having to create explicit use of configuration files (and I’m not even sure that’s possible)? Is there any sort of system configuration that permits the selection order/weighting used by FontConfig to be modified?

I’ve looked in FontForge but that app doesn’t seem to show the foundry attribute much less have a way to modify it.

Thanks for any suggestions.
 
Old 04-01-2015, 01:40 PM   #2
mdooligan
Member
 
Registered: Feb 2009
Location: Vancouver BC
Distribution: Mandrake10/ArchHackery/Gentoo
Posts: 179

Rep: Reputation: 22
Fonts and Linux have always been quite the gong show in my experience.

The best way that I've found to keep track of things is to set up your X11/fonts directory with subdirs based upon manual viewing and matching of fonts. I have miscfixed, script, terminal, 75dpi, 100 dpi, oddball, and a few others. I have them in ttf, bdf, pcf, afm/pfa, fon. I'm sure I'm missing a couple types there. They are stored in my X11/fonts dir, ghostscript repository, /usr/share/fonts, individual app dirs, you name it, I've even found them in /etc.

About a year ago I was messing around, trying to clean them up so I knew exactly which fonts I had. So many of them are aliased. For example your LibreOffice might say you have Helvetica, but it's actually just an alias for Arial or something. Mix and match with known similar fonts is the order of the day.

So, in answer to your question, if you want to track and categorize your fonts, it's very much up to you which way you do it. XFontserver might help, but I found that program to be lacking robustness so bad I stopped using it years ago. xset can be your friend here too.

When I'm playing with fonts here's a script I use. It also has a bunch of commentary that may or may not make any sense.
Code:
#!/bin/sh

CMD="mkfontscale; mkfontdir"

DIR="$PWD"
for dir in $(find $DIR -type d | grep -v '\.'); do
    echo "Entering $dir..."
    cd $dir
    echo $CMD
    eval $CMD
#    cd $DIR
done
#eval $CMD

fc-cache -fv

xset fp rehash

exit

# set your fontpaths
# xset fp+ fontdir
# xset fp rehash
# or edit XF86Config-4
#
# you can hand craft a 'fonts.alias' in the dir
# where a font lives. See miscfixed/fonts.alias
#
# gimp uses X fonts
# xpdf uses X fonts
# gsview uses ghostscript fonts
# OpenOffice uses X fonts but also supplies it's own
# God knows what Opera uses for fonts
#
# we have xlsfonts, fc-list
# there is stuff in /etc/fonts
# usr/(local/)share/fonts
# /usr/X11R6/lib/X11/fonts
#
#***
#
#If you add a directory, update fc-cache-1 AND
#/usr/X11R6/lib/X11/fs/config.
#
#If you add fonts to a directory, run
#
#mkfontscale; mkfontdir; fc-cache
#
#fc-cache -fv seems to rebuild X font collection.
#Font dirs are in /etc/fonts/fonts.conf and local.conf.
#
#in that dir. Once you're done fiddling with fonts.
#log in as root and do
#
#service xfs restart.
#
#Bob's yer uncle.
#
#Oh yeah, you can use /usr/share/fonts also.
#
#***
#
Take care and good luck.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Fontconfig trouble with setting default font families bl0tt0 Slackware 2 03-23-2015 01:30 PM
fatal error: fontconfig/fontconfig.h: No such file or directory bogzab Slackware 3 11-07-2011 04:13 PM
Font problems after installing fontconfig usg Linux - Software 0 06-23-2006 08:34 AM
fontconfig: Didn't find expected font family toffi22 Linux - Software 1 06-27-2005 01:04 PM
Help with freetype-2.1.7 & fontconfig-2.2.0 please MsticAzn Linux - Software 0 02-25-2004 01:13 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:37 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration