4

I'm trying to change the font inside of my pstricks code, but I can't change to the font I want to use. I'd rather use another code instead \usefont. This is my code:

\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}

I set on my document the Palatino font, but the text in pstricks I would like to use a font from here http://www.tug.dk/FontCatalogue/. Can you guys help me out?

  • 1
    Which package do you use to load palatino? Pstricks, as fra as I know uses the font that LaTeX tells it to use, no more, no less. If your package defines after helvetica as the sans font, you just have to say \sffamily after \begin{pspicture} – Bernard Mar 19 '14 at 21:01
  • I don't really understand this question. The fact that the code is not complete doesn't help. However, if I complete it, it works as I suspect you expect. So I'm not sure what the question is. You've asked for Helvetica and that's what you get. I'm not sure why you put text in mathematics but it still seems to work. If you want another font, of course specify another font. What exactly is the question? Are you asking us to guess which font you might be having trouble with? – cfr Mar 19 '14 at 23:35
  • It is true that you shouldn't do it this way. However, I'm not sure whether that's your question or not. – cfr Mar 19 '14 at 23:36
5

Since I'm not sure what the question is (see queries in comments to original question), I'm obviously not sure if this answers it. However, I hope that it will at least be helpful and perhaps help sharpen the question if nothing else.

This example shows how to use two fonts within the picture. The first, Zapf Chancery, is configured directly. We set up \zapfstyle (analogous to \itshape, \bfseries etc.) and \textzf{} (analogous to \textit{}, \textbf{} etc.).

For the second, Brush Script, we make use of the provided package pbsi. This defines the two analogous commands for us as \bsifamily and \textbsi{}.

The code

\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}

The output

Zapf Chancery and Brush Script in <code>pspicture</code>

3

phv is the fontname for 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}

or for a special font, eg Times:

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

enter image description here

  • But what i'm trying to do is put the font whatever i want. – Levy Mar 19 '14 at 21:21
  • see edited answer – user2478 Mar 20 '14 at 8:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.