Ajouter une nouvelle police sous Linux

book
date_range
comment0 commentaire
remove_red_eye2347 vues

Google Fonts 

Voici comment simplement ajouter une nouvelle police sur votre serveur Linux. Cela m'a été très utile pour réduire le temps de chargement d'une page sous Apache en mettant la police en cache sur le serveur.

Où sont stockées les polices ?

Les polices sous Linux sont stockées dans les répertoires suivant :

/usr/share/fonts
/usr/local/share/fonts

Ajouter une police sous Linux

Pour ajouter votre police sur votre serveur, il vous suffit de la placer dans un des répertoires donné ci-dessus.

# on se déplace dans le dossier des polices
cd /usr/share/fonts

# on télécharge la police choisie (ici une police Google Fonts)
wget https://www.google.com/fonts/download?kit=0mg5GC3rn5mAhPYzNd077aCWcynf_cDxXwCLxiixG1c

# on dézippe le zip obtenu
unzip download\?kit\=0mg5GC3rn5mAhPYzNd077aCWcynf_cDxXwCLxiixG1c

# on supprime les dossiers résiduels
rm -v download\?kit\=0mg5GC3rn5mAhPYzNd077aCWcynf_cDxXwCLxiixG1c

Pour ensuite ajouter cette police dans le fichier de cache des polices

fc-cache -f -v

Vérifier que la police à été installée

fc-list | grep "ma police"

Exemples d'exécution

fc-cache

root@alexandre:/home/dinath# fc-cache -f -v
/usr/share/fonts: caching, new cache contents: 23 fonts, 3 dirs
/usr/share/fonts/X11: caching, new cache contents: 0 fonts, 3 dirs
/usr/share/fonts/X11/Type1: caching, new cache contents: 35 fonts, 0 dirs
/usr/share/fonts/X11/encodings: caching, new cache contents: 0 fonts, 1 dirs
/usr/share/fonts/X11/encodings/large: caching, new cache contents: 0 fonts, 0 dirs
/usr/share/fonts/X11/util: caching, new cache contents: 0 fonts, 0 dirs
/usr/share/fonts/truetype: caching, new cache contents: 0 fonts, 2 dirs
/usr/share/fonts/truetype/liberation: caching, new cache contents: 16 fonts, 0 dirs
/usr/share/fonts/truetype/ttf-dejavu: caching, new cache contents: 6 fonts, 0 dirs
/usr/share/fonts/type1: caching, new cache contents: 0 fonts, 1 dirs
/usr/share/fonts/type1/gsfonts: caching, new cache contents: 35 fonts, 0 dirs
/usr/X11R6/lib/X11/fonts: skipping, no such directory
/usr/local/share/fonts: caching, new cache contents: 0 fonts, 0 dirs
/root/.fonts: skipping, no such directory
/var/cache/fontconfig: cleaning cache directory
/root/.fontconfig: not cleaning non-existent cache directory
fc-cache: succeeded

fc-list

root@alexandre:/home/dinath# fc-list
/usr/share/fonts/Lato-LightItalic.ttf: Lato,Lato Light:style=Light Italic,Italic
/usr/share/fonts/X11/Type1/s050000l.pfb: Standard Symbols L:style=Regular
/usr/share/fonts/Lato-BoldItalic.ttf: Lato:style=Bold Italic
/usr/share/fonts/X11/Type1/p052024l.pfb: URW Palladio L:style=Bold Italic
/usr/share/fonts/truetype/liberation/LiberationSansNarrow-Italic.ttf: Liberation Sans Narrow:style=Italic
/usr/share/fonts/type1/gsfonts/n021024l.pfb: Nimbus Roman No9 L:style=Medium Italic
/usr/share/fonts/X11/Type1/p052023l.pfb: URW Palladio L:style=Italic
/usr/share/fonts/type1/gsfonts/n021004l.pfb: Nimbus Roman No9 L:style=Medium
/usr/share/fonts/truetype/liberation/LiberationSans-Regular.ttf: Liberation Sans:style=Regular
/usr/share/fonts/X11/Type1/b018015l.pfb: URW Bookman L:style=Demi Bold
/usr/share/fonts/type1/gsfonts/p052023l.pfb: URW Palladio L:style=Italic
/usr/share/fonts/type1/gsfonts/n022003l.pfb: Nimbus Mono L:style=Regular
/usr/share/fonts/truetype/liberation/LiberationMono-BoldItalic.ttf: Liberation Mono:style=Bold Italic
/usr/share/fonts/X11/Type1/z003034l.pfb: URW Chancery L:style=Medium Italic
/usr/share/fonts/Raleway-Thin.ttf: Raleway:style=Thin
/usr/share/fonts/truetype/liberation/LiberationSerif-Italic.ttf: Liberation Serif:style=Italic
/usr/share/fonts/type1/gsfonts/z003034l.pfb: URW Chancery L:style=Medium Italic
/usr/share/fonts/X11/Type1/c059016l.pfb: Century Schoolbook L:style=Bold
/usr/share/fonts/truetype/liberation/LiberationMono-Bold.ttf: Liberation Mono:style=Bold
/usr/share/fonts/truetype/ttf-dejavu/DejaVuSerif.ttf: DejaVu Serif:style=Book
/usr/share/fonts/X11/Type1/a010033l.pfb: URW Gothic L:style=Book Oblique
/usr/share/fonts/X11/Type1/a010015l.pfb: URW Gothic L:style=Demi
/usr/share/fonts/X11/Type1/n019003l.pfb: Nimbus Sans L:style=Regular
/usr/share/fonts/type1/gsfonts/c059013l.pfb: Century Schoolbook L:style=Roman
/usr/share/fonts/truetype/liberation/LiberationSansNarrow-Regular.ttf: Liberation Sans Narrow:style=Regular
/usr/share/fonts/Lato-Black.ttf: Lato,Lato Black:style=Black,Regular
/usr/share/fonts/type1/gsfonts/d050000l.pfb: Dingbats:style=Regular
/usr/share/fonts/X11/Type1/n019004l.pfb: Nimbus Sans L:style=Bold
/usr/share/fonts/X11/Type1/d050000l.pfb: Dingbats:style=Regular
/usr/share/fonts/type1/gsfonts/n021023l.pfb: Nimbus Roman No9 L:style=Regular Italic
/usr/share/fonts/Lato-BlackItalic.ttf: Lato,Lato Black:style=Black Italic,Italic
/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf: DejaVu Sans:style=Book
/usr/share/fonts/X11/Type1/p052004l.pfb: URW Palladio L:style=Bold
/usr/share/fonts/type1/gsfonts/n019063l.pfb: Nimbus Sans L:style=Regular Condensed Italic
/usr/share/fonts/Raleway-ExtraLight.ttf: Raleway:style=ExtraLight
/usr/share/fonts/truetype/liberation/LiberationSerif-Bold.ttf: Liberation Serif:style=Bold
/usr/share/fonts/type1/gsfonts/a010013l.pfb: URW Gothic L:style=Book
/usr/share/fonts/X11/Type1/n022024l.pfb: Nimbus Mono L:style=Bold Oblique
/usr/share/fonts/Raleway-SemiBold.ttf: Raleway:style=SemiBold
/usr/share/fonts/truetype/liberation/LiberationMono-Regular.ttf: Liberation Mono:style=Regular
/usr/share/fonts/truetype/ttf-dejavu/DejaVuSansMono-Bold.ttf: DejaVu Sans Mono:style=Bold
/usr/share/fonts/type1/gsfonts/n019064l.pfb: Nimbus Sans L:style=Bold Condensed Italic
/usr/share/fonts/truetype/liberation/LiberationSans-Italic.ttf: Liberation Sans:style=Italic
/usr/share/fonts/type1/gsfonts/p052004l.pfb: URW Palladio L:style=Bold
/usr/share/fonts/a010035l.pfb: URW Gothic L:style=Demi Oblique
/usr/share/fonts/X11/Type1/n019063l.pfb: Nimbus Sans L:style=Regular Condensed Italic
/usr/share/fonts/Lato-Light.ttf: Lato,Lato Light:style=Light,Regular
/usr/share/fonts/truetype/liberation/LiberationSerif-BoldItalic.ttf: Liberation Serif:style=Bold Italic
/usr/share/fonts/X11/Type1/n021024l.pfb: Nimbus Roman No9 L:style=Medium Italic
/usr/share/fonts/type1/gsfonts/n022023l.pfb: Nimbus Mono L:style=Regular Oblique
/usr/share/fonts/Lato-Italic.ttf: Lato:style=Italic
/usr/share/fonts/X11/Type1/b018032l.pfb: URW Bookman L:style=Light Italic
/usr/share/fonts/X11/Type1/n021004l.pfb: Nimbus Roman No9 L:style=Medium
/usr/share/fonts/X11/Type1/n022003l.pfb: Nimbus Mono L:style=Regular
/usr/share/fonts/type1/gsfonts/a010015l.pfb: URW Gothic L:style=Demi
/usr/share/fonts/truetype/liberation/LiberationSansNarrow-BoldItalic.ttf: Liberation Sans Narrow:style=Bold Italic
/usr/share/fonts/Raleway-Heavy.ttf: Raleway:style=Heavy
/usr/share/fonts/type1/gsfonts/n019043l.pfb: Nimbus Sans L:style=Regular Condensed
/usr/share/fonts/Raleway-Bold.ttf: Raleway:style=Bold
/usr/share/fonts/Raleway-Medium.ttf: Raleway:style=Medium
/usr/share/fonts/X11/Type1/a010035l.pfb: URW Gothic L:style=Demi Oblique
/usr/share/fonts/truetype/ttf-dejavu/DejaVuSerif-Bold.ttf: DejaVu Serif:style=Bold
/usr/share/fonts/type1/gsfonts/n019044l.pfb: Nimbus Sans L:style=Bold Condensed
/usr/share/fonts/X11/Type1/n019023l.pfb: Nimbus Sans L:style=Regular Italic
/usr/share/fonts/X11/Type1/n019044l.pfb: Nimbus Sans L:style=Bold Condensed
/usr/share/fonts/Raleway-Light.ttf: Raleway:style=Light
/usr/share/fonts/X11/Type1/n019024l.pfb: Nimbus Sans L:style=Bold Italic
/usr/share/fonts/type1/gsfonts/a010033l.pfb: URW Gothic L:style=Book Oblique
/usr/share/fonts/Raleway-ExtraBold.ttf: Raleway:style=ExtraBold
/usr/share/fonts/type1/gsfonts/n021003l.pfb: Nimbus Roman No9 L:style=Regular
/usr/share/fonts/type1/gsfonts/s050000l.pfb: Standard Symbols L:style=Regular
/usr/share/fonts/truetype/liberation/LiberationMono-Italic.ttf: Liberation Mono:style=Italic
/usr/share/fonts/truetype/liberation/LiberationSans-BoldItalic.ttf: Liberation Sans:style=Bold Italic
/usr/share/fonts/type1/gsfonts/b018035l.pfb: URW Bookman L:style=Demi Bold Italic
/usr/share/fonts/type1/gsfonts/c059033l.pfb: Century Schoolbook L:style=Italic
/usr/share/fonts/X11/Type1/n021003l.pfb: Nimbus Roman No9 L:style=Regular
/usr/share/fonts/a010015l.pfb: URW Gothic L:style=Demi
/usr/share/fonts/type1/gsfonts/a010035l.pfb: URW Gothic L:style=Demi Oblique
/usr/share/fonts/a010033l.pfb: URW Gothic L:style=Book Oblique
/usr/share/fonts/truetype/liberation/LiberationSerif-Regular.ttf: Liberation Serif:style=Regular
/usr/share/fonts/X11/Type1/c059013l.pfb: Century Schoolbook L:style=Roman
/usr/share/fonts/X11/Type1/b018035l.pfb: URW Bookman L:style=Demi Bold Italic
/usr/share/fonts/type1/gsfonts/n019023l.pfb: Nimbus Sans L:style=Regular Italic
/usr/share/fonts/type1/gsfonts/b018012l.pfb: URW Bookman L:style=Light
/usr/share/fonts/X11/Type1/c059036l.pfb: Century Schoolbook L:style=Bold Italic
/usr/share/fonts/a010013l.pfb: URW Gothic L:style=Book
/usr/share/fonts/Lato-HairlineItalic.ttf: Lato,Lato Hairline:style=Hairline Italic,Italic
/usr/share/fonts/X11/Type1/a010013l.pfb: URW Gothic L:style=Book
/usr/share/fonts/type1/gsfonts/c059016l.pfb: Century Schoolbook L:style=Bold
/usr/share/fonts/type1/gsfonts/n022004l.pfb: Nimbus Mono L:style=Bold
/usr/share/fonts/X11/Type1/b018012l.pfb: URW Bookman L:style=Light
/usr/share/fonts/type1/gsfonts/n019024l.pfb: Nimbus Sans L:style=Bold Italic
/usr/share/fonts/type1/gsfonts/b018032l.pfb: URW Bookman L:style=Light Italic
/usr/share/fonts/type1/gsfonts/p052003l.pfb: URW Palladio L:style=Roman
/usr/share/fonts/X11/Type1/c059033l.pfb: Century Schoolbook L:style=Italic
/usr/share/fonts/truetype/liberation/LiberationSansNarrow-Bold.ttf: Liberation Sans Narrow:style=Bold
/usr/share/fonts/truetype/liberation/LiberationSans-Bold.ttf: Liberation Sans:style=Bold
/usr/share/fonts/X11/Type1/n022004l.pfb: Nimbus Mono L:style=Bold
/usr/share/fonts/X11/Type1/n022023l.pfb: Nimbus Mono L:style=Regular Oblique
/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans-Bold.ttf: DejaVu Sans:style=Bold
/usr/share/fonts/X11/Type1/n021023l.pfb: Nimbus Roman No9 L:style=Regular Italic
/usr/share/fonts/type1/gsfonts/n019004l.pfb: Nimbus Sans L:style=Bold
/usr/share/fonts/type1/gsfonts/b018015l.pfb: URW Bookman L:style=Demi Bold
/usr/share/fonts/truetype/ttf-dejavu/DejaVuSansMono.ttf: DejaVu Sans Mono:style=Book
/usr/share/fonts/X11/Type1/p052003l.pfb: URW Palladio L:style=Roman
/usr/share/fonts/type1/gsfonts/n022024l.pfb: Nimbus Mono L:style=Bold Oblique
/usr/share/fonts/Lato-Bold.ttf: Lato:style=Bold
/usr/share/fonts/Lato-Hairline.ttf: Lato,Lato Hairline:style=Hairline,Regular
/usr/share/fonts/Raleway-Regular.ttf: Raleway:style=Regular
/usr/share/fonts/X11/Type1/n019043l.pfb: Nimbus Sans L:style=Regular Condensed
/usr/share/fonts/type1/gsfonts/c059036l.pfb: Century Schoolbook L:style=Bold Italic
/usr/share/fonts/type1/gsfonts/p052024l.pfb: URW Palladio L:style=Bold Italic
/usr/share/fonts/X11/Type1/n019064l.pfb: Nimbus Sans L:style=Bold Condensed Italic
/usr/share/fonts/Lato-Regular.ttf: Lato:style=Regular
/usr/share/fonts/type1/gsfonts/n019003l.pfb: Nimbus Sans L:style=Regular

Articles similaires

Commentaires

Aucun commentaire

Ajouter un commentaire

Vous ne disposez pas les autorisations nécessaires pour poster un commentaire.