程式碼

程式碼

我正在嘗試更改 pstricks 程式碼內的字體,但無法更改為我想要使用的字體。我寧願使用另一個代碼\usefont。這是我的程式碼:

\thispagestyle{empty}
\newgeometry{left=0cm,right=0cm,top=0cm,bottom=0cm}
\begin{pspicture}(0cm,29.7cm)
\newsavebox\IBox
\sbox\IBox{\includegraphics[height=29.7cm,width=21cm]{Capa2.eps}}
\psset{unit=1cm}
\rput[lb](-0.63,0){\usebox\IBox}

\rput(9.02,25.7){\usefont{T1}{phv}{b}{n}\fontsize{48pt}{48pt}\color{white}\selectfont $\text{Anotações Sobre o}$}

\rput(8.3,23.7){\usefont{T1}{phv}{b}{n}\fontsize{54pt}{48pt}\color{white}\selectfont $\text{Operador Nabla}$}
\end{pspicture}

我在文件中設定了 Palatino 字體,但 pstricks 中的文字我想使用此處的字體http://www.tug.dk/FontCatalogue/。你們能幫我一下嗎?

答案1

由於我不確定問題是什麼(請參閱原始問題的評論中的查詢),因此我顯然不確定這是否能回答它。然而,我希望它至少會有所幫助,如果沒有其他的話,也許有助於尖銳化這個問題。

此範例展示如何在圖片中使用兩種字體。第一個是 Zapf Chancery,是直接配置的。我們建立\zapfstyle(類似\itshape\bfseries) 和\textzf{}(類似\textit{}\textbf{})。

對於第二個 Brush Script,我們使用提供的套件pbsi。這為我們定義了兩個類似的命令:\bsifamily\textbsi{}

程式碼

\documentclass[a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{pstricks}
\usepackage{graphicx,geometry,amsmath}
\newsavebox\IBox
\sbox\IBox{\includegraphics[height=29.7cm,width=21cm]{example-image-a}}
% Use Zapf Chancery as an example, setting up the relevant font commands for use in the document
\DeclareRobustCommand{\zapfstyle}{% like \itshape etc., this command will hold until an explicit switch or end of group
        \fontencoding{T1}%
        \fontseries{mb}%
        \fontshape{it}%
        \fontfamily{pzc}%
        \selectfont}
\DeclareTextFontCommand{\textzf}{\zapfstyle}% like \textit{} etc., this command takes an argument and affects only that argument
% brushscr has a package file, pbsi.sty which defines the relevant font commands so use this
\usepackage{pbsi}% defines \bsifamily and \textbsi{}

\begin{document}
\newgeometry{left=0cm,right=0cm,top=0cm,bottom=0cm}
\begin{pspicture}(0cm,29.7cm)
\rput[lb](-0.63,0){\usebox\IBox}
\rput(9.02,25.7){\textcolor{white}{\zapfstyle\Huge Anotações Sobre o}}
\rput(8.3,23.7){\textcolor{white}{\zapfstyle\Huge Operador Nabla}}
\end{pspicture}
\newpage
\begin{pspicture}(0cm,29.7cm)
\psset{unit=1cm}
\rput[lb](-0.63,0){\usebox\IBox}
\rput(9.02,25.7){\color{white}\bsifamily\LARGE Anotações Sobre o}
\rput(8.3,23.7){\color{white}\bsifamily\Huge Operador Nabla}
\end{pspicture}
\end{document}

輸出

<code>pspicture</code> 中的 Zapf Chancery 和畫筆腳本

答案2

phv是 Helvetica 的字型名

\documentclass[a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{pstricks}
\usepackage{helvet}
\usepackage{graphicx}
\usepackage{geometry}

\begin{document}
\newgeometry{left=0cm,right=0cm,top=0cm,bottom=0cm}
\begin{pspicture}(0cm,29.7cm)
\newsavebox\IBox
\sbox\IBox{\includegraphics[height=29.7cm,width=21cm]{tiger}}
\rput[lb](-0.63,0){\usebox\IBox}
\rput(9.02,25.7){\textcolor{white}{\sffamily\Huge Anotações Sobre o}}
\rput(8.3,23.7){\textcolor{white}{\sffamily\Huge Operador Nabla}}
\end{pspicture}

\end{document}

或特殊字體,例如 Times:

\rput(8.3,23.7){\usefont{T1}{ptm}{b}{it}\selectfont
    \textcolor{white}{\sffamily\Huge Operador Nabla}}

在此輸入影像描述

相關內容