使用 Fontawesome 包设置默认字体

使用 Fontawesome 包设置默认字体

最近我问了如何使用 font awesome 软件包将一些徽标(skype、linkedin、Facebook 等)添加到我的简历中。感谢这里的人们为我提供了很好的答案。但是,我注意到整个文档的字体都变了。

这对我来说很遗憾,因为我非常喜欢默认字体,我想在整个文档中使用。因此,我该如何将默认字体设置为以下代码?

% PACKAGES
% ---------------------------------------------------------------------

\documentclass[a4paper, 10 pt, oneside, final]{scrartcl}
\usepackage[left=4.6cm, right=0.75cm, top=0.5cm, bottom=0.5cm]{geometry}
\usepackage{soul}
\usepackage{scrpage2}
\usepackage{titlesec}
\usepackage{marvosym}
\usepackage{tabularx}
\usepackage[francais]{babel}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\pagestyle{empty}
\usepackage{enumitem}
\usepackage{color}
\usepackage{wrapfig}
\usepackage{graphicx}
\usepackage{amsmath,amssymb,mathrsfs}
\usepackage{scrextend}
\usepackage{marvosym}

\usepackage{xcolor}
\definecolor{blue}{RGB}{0,25,80}


% Title format
\titleformat{\section}{\large\scshape\raggedright}{}{0em}{} [{\color{blue}\vskip-\topskip\rule{\linewidth}{0.8pt}}]
\titlespacing*{\section}
{0pt}{0ex plus 0ex minus 0ex}{0ex plus 0ex}


% Title line color


% Left margin
\reversemarginpar
\marginparwidth 96pt

% Computer skills 
\usepackage{tikz}
\newcommand{\grade}[1]{%
    \begin{tikzpicture}
        \clip (1em-.3em,-.3em) rectangle (5em +.5em ,.3em);
        \begin{scope}
            \clip (1em-.3em,-.3em) rectangle (#1em +.5em ,.3em);
            \foreach \x in {1,2,...,5}{
                \path[fill=blue] (\x em,0) circle (.27em);
            }
        \end{scope}
        \foreach \x in {1,2,...,5}{
            \draw[color=blue] (\x em,0) circle (.27em);
        }
    \end{tikzpicture}%
}



\usepackage{fontspec}%<added
\usepackage{libertine}%<added


\newfontfamily{\FA}[Path=/Users/arnaudmonay/Desktop/AM_CV_UK/,Scale=.80]{FontAwesome.otf}
\def\fafacebooksq{{\FA \symbol{"F082}}}
\def\faphone{{\FA \symbol{"F095}}}
\def\faphonesq{{\FA \symbol{"F098}}}
\def\fatwitter{{\FA \symbol{"F099}}}
\def\fakeyboardo{{\FA \symbol{"F11C}}}





% DOCUMENT
% ---------------------------------------------------------------------
\begin{document}


% Command label item
\renewcommand{\labelitemi}{\raise .5ex\hbox{\tiny$\bullet$}}
\newcommand{\mymarginnote}[1]{\leavevmode
\marginpar{\normalsize\textcolor{black}{#1}}%
\ignorespaces}



\setlength\parindent{0pt}


% Personal informations and picture
\setlength{\fboxsep}{0pt}%
\setlength{\fboxrule}{0.7pt}%
\begin{wrapfigure}{r}{00mm}
    \hfill
    \fbox{\includegraphics[scale=0.12]{cv_picture.jpg}}
\end{wrapfigure} 

\mymarginnote{\smash{\fontsize{10.5}{12}\textbf{Branch Warren}}}
\mbox{}

\mymarginnote{\faphonesq route 17 \\ aabama 76 \\ Switzerland \\ \faphone +4176 67 34 56 \\ branchwarren} 
Born on the 2th of March  1887

US nationality

\textcolor{red}{\fakeyboardo}[email protected]

\fatwitter~twitter

\fafacebooksq~facebook

\end{document}

非常感谢所有能帮助我的人

答案1

使用该包并使用或fontawesome运行它。请执行lualatexxelatex不是 加载包inputenc不是 fontenc并使用已经定义的宏fontawesome

\documentclass[a4paper, 10 pt, oneside, final]{scrartcl}
\usepackage[left=4.6cm, right=3.75cm, top=0.5cm, bottom=0.5cm]{geometry}
\usepackage{amsmath,amssymb,mathrsfs}
\usepackage{marginnote}
\usepackage{marvosym}
\usepackage{fontspec}%<added
\usepackage{libertine}%<added
\usepackage{fontawesome}
\usepackage[francais]{babel}
\usepackage{xcolor}
\begin{document}    
\marginnote{\faPhoneSquare route 17 \\ aabama 76 \\ Switzerland \\ \faPhone +4176 67 34 
    56 \\ branchwarren} 
    Born on the 2th of March  1887

    US nationality

    \textcolor{red}{\faKeyboardO}[email protected]

    \faTwitter~twitter

    \faFacebookSquare~facebook

\end{document}

在此处输入图片描述

相关内容