## LaTeX forum ⇒ Fonts & Character Sets ⇒ Use a local font in a class file

Information and discussion about fonts and character sets (e.g. how to use language specific characters)
knp
Posts: 2
Joined: Fri Sep 21, 2018 3:04 pm

### Use a local font in a class file

Hi everyone,

I'm a beginner on LaTeX and I've been spending too much time on that small issue that I can't give up. That's pretty basic I guess, but I can't manage to find the accurate instruction despite hours of trying.

I want to create my own CV from this template : https://www.latextemplates.com/template ... s-resumecv

What I want to do is to remove the original font of the template by a local font of my computer, let's say the "Ubuntu" font.

I understand XeLaTex is needed. I installed it. Now if in a TexMaker blank file I type :

\documentclass[a4paper]{article}\usepackage{fontspec}\usepackage{lipsum}\XeTeXdefaultencoding utf-8\defaultfontfeatures{Mapping=tex-text}\setmainfont{Ubuntu}\begin{document}\section{Custom fonts}\lipsum[1]\end{document}

I then get a file with the Ubuntu font. However there is no way to get this Ubuntu font on that CV, in the .tex file. "setmainfont" doesn't work, "renewfamilykinda" neither.

I guess instructions should be written in the class file .cls of the CV, but everything I tried did not work.

Last edited by knp on Fri Sep 21, 2018 5:18 pm, edited 1 time in total.

knp
Posts: 2
Joined: Fri Sep 21, 2018 3:04 pm
Some news on my attempt :

I've been trying to install two .sty files following this method : https://ubuntuforums.org/showthread.php?t=2341382

Which consists on the execution of these lines in the terminal :
sudo mkdir /usr/share/texmf/tex/latex/ubuntusudo cp foo.sty /usr/share/texmf/tex/latex/ubuntusudo texhash

But the use of the line \usepackage{ubuntu} in both my template or my .cls file give no results.

Johannes_B
Site Moderator
Posts: 4074
Joined: Thu Nov 01, 2012 4:08 pm
If the fonts are properly installed on the system, XeLaTeX should have no problems finding them. There shouldn't be any need to change a class file, which is discouraged anyway due to license issues.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.