Fonts & Character SetsRaster fonts in PDF

Information and discussion about fonts and character sets (e.g. how to use language specific characters)
vgi
Posts: 11
Joined: Fri Nov 08, 2013 11:46 am

Raster fonts in PDF

Post by vgi »

Hi!

I have a problem with vector fonts in pdf.

Let's take a sample file (sample.tex):

Code: Select all

\documentclass[russian,english]{article}
\usepackage[cp1251]{inputenc}
\usepackage{babel}
\begin{document}
\noindent ABC
\selectlanguage{russian}
\noindent ДЖЫ
\noindent ABC
\end{document}
After running

Code: Select all

latex sample.tex
dvipdfm sample.dvi
we get a sample.pdf. On the picture one can see that the first "ABC" proves to be in a vector font, but after switching to Russian both "ДЖЫ" and the second "ABC" are raster. How can I make a pdf with vector Russian fonts?

WBR,
Vladimir.

P.S. I use MikTeX 2.9.6730 now and do remember very well that in some earlier version of MikTeX there were no such problem. All fonts in pdf were vector ones.
Attachments
sample.png
sample.png (24.86 KiB) Viewed 11252 times

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
rais
Posts: 419
Joined: Sun Nov 16, 2014 8:51 pm

Raster fonts in PDF

Post by rais »

Hi to you, too!
Do you get the same result when running pdfLaTeX directly?
Then post the last couple of lines of your sample.log file of that pdfLaTeX run (where it lists the fonts used, each enclosed in <>).
My guess is, you're using cm standard font now and you used cm-super before.

KR
Rainer
User avatar
Stefan Kottwitz
Site Admin
Posts: 10290
Joined: Mon Mar 10, 2008 9:44 pm

Raster fonts in PDF

Post by Stefan Kottwitz »

Hi Vladimir!

You can install cm-super, that Rainer mentioned, as a normal package using the MiKTeX package manager. You don't need to add something in the code, it's automatically used if needed. Actually, it's used when T1 font encoding is enabled. That's actually recommendable.

So, if you verified that cm-super is installed, you can enable the (better, newer, non-default) T1 font encoding by

Code: Select all

\usepackage[T1]{fontenc}
Test, if it improved.

If it doesn't, there's another option. The Latin Modern font was designed to be a future replacement for the default Computer Modern font. It's very similar and of high quality. You can load it by

Code: Select all

\usepackage{lmodern}
and keept the fontenc line.

Stefan
LaTeX.org admin
vgi
Posts: 11
Joined: Fri Nov 08, 2013 11:46 am

Raster fonts in PDF

Post by vgi »

Hi, Rainer!
rais wrote: Do you get the same result when running pdfLaTeX directly?
Yes.
rais wrote: Then post the last couple of lines of your sample.log file of that pdfLaTeX run (where it lists the fonts used, each enclosed in <>).
Do you mean these lines?

Code: Select all

LaTeX Font Info:    Checking defaults for OML/cmm/m/it on input line 8.
LaTeX Font Info:    ... okay on input line 8.
LaTeX Font Info:    Checking defaults for T1/cmr/m/n on input line 8.
LaTeX Font Info:    ... okay on input line 8.
LaTeX Font Info:    Checking defaults for OT1/cmr/m/n on input line 8.
LaTeX Font Info:    ... okay on input line 8.
LaTeX Font Info:    Checking defaults for OMS/cmsy/m/n on input line 8.
LaTeX Font Info:    ... okay on input line 8.
LaTeX Font Info:    Checking defaults for OMX/cmex/m/n on input line 8.
LaTeX Font Info:    ... okay on input line 8.
LaTeX Font Info:    Checking defaults for U/cmr/m/n on input line 8.
LaTeX Font Info:    ... okay on input line 8.
LaTeX Font Info:    Checking defaults for T2A/cmr/m/n on input line 8.
LaTeX Font Info:    Try loading font information for T2A+cmr on input line 8.
("C:\Program Files\MiKTeX 2.9\tex\latex\cyrillic\t2acmr.fd"
File: t2acmr.fd 2001/08/11 v1.0a Computer Modern Cyrillic font definitions
)
LaTeX Font Info:    ... okay on input line 8.
vgi
Posts: 11
Joined: Fri Nov 08, 2013 11:46 am

Raster fonts in PDF

Post by vgi »

Hi, Stefan!

If I insert

Code: Select all

\usepackage[T1]{fontenc}
ALL three lines prove to be in raster fonts.

With

Code: Select all

\usepackage{lmodern}
no changes at all.
vgi
Posts: 11
Joined: Fri Nov 08, 2013 11:46 am

Raster fonts in PDF

Post by vgi »

P.S. I have tried TeX Live 2017 now and it works fine: all fonts in pdf are vector.

Nevertheless, it would be great to understand what is bad with MikTeX.
rais
Posts: 419
Joined: Sun Nov 16, 2014 8:51 pm

Raster fonts in PDF

Post by rais »

Hi Vladimir,
vgi wrote:
rais wrote: Then post the last couple of lines of your sample.log file of that pdfLaTeX run (where it lists the fonts used, each enclosed in <>).
Do you mean these lines?

Code: Select all

LaTeX Font Info:    Checking defaults for OML/cmm/m/it on input line 8.
LaTeX Font Info:    ... okay on input line 8.
no, I meant a similar block to this:

Code: Select all

{c:/texlive/2016/texmf-dist/fonts/enc/dvips/cm-super/cm-super-t2a.enc}<c:/texlive
/2016/texmf-dist/fonts/type1/public/amsfonts/cm/cmr10.pfb><c:/texlive/2016/texm
f-dist/fonts/type1/public/cm-super/sfrm1000.pfb>
It's usually written close to the end of the log file (notice the <> characters enclosing each (path to) font file used.

KR
Rainer
vgi
Posts: 11
Joined: Fri Nov 08, 2013 11:46 am

Raster fonts in PDF

Post by vgi »

Here it is:

Code: Select all

<C:\Users\v\AppData\Local\MiKTeX\2.9\fonts\pk\ljfour\lh\lh-t2a\dpi600\larm1000
.pk><C:/Program Files/MiKTeX 2.9/fonts/type1/public/amsfonts/cm/cmr10.pfb>
I guess the reason is larm1000.pk. How to deal with it?
rais
Posts: 419
Joined: Sun Nov 16, 2014 8:51 pm

Raster fonts in PDF

Post by rais »

Hi Vladimir,
sorry for the late reply, I'm currently a bit out of sync.

I'd still say you're missing the cm-super fonts in your MikTeX installation.
What does the same section give you under TeXLive? Since it's working there, I'd assume you've got cm-super installed in TL but not in MikTeX...

KR
Rainer
vgi
Posts: 11
Joined: Fri Nov 08, 2013 11:46 am

Raster fonts in PDF

Post by vgi »

rais wrote: What does the same section give you under TeXLive?
It gives

Code: Select all

{c:/WINPROG/texlive/2017/texmf-dist/fonts/enc/dvips/cm-super/cm-super-t2a.enc
}<c:/WINPROG/texlive/2017/texmf-dist/fonts/type1/public/amsfonts/cm/cmmi5.pfb><
c:/WINPROG/texlive/2017/texmf-dist/fonts/type1/public/amsfonts/cm/cmmi6.pfb><c:
/WINPROG/texlive/2017/texmf-dist/fonts/type1/public/amsfonts/cm/cmmi9.pfb><c:/W
INPROG/texlive/2017/texmf-dist/fonts/type1/public/amsfonts/cm/cmr10.pfb><c:/WIN
PROG/texlive/2017/texmf-dist/fonts/type1/public/amsfonts/cm/cmr5.pfb><c:/WINPRO
G/texlive/2017/texmf-dist/fonts/type1/public/amsfonts/cm/cmr6.pfb><c:/WINPROG/t
exlive/2017/texmf-dist/fonts/type1/public/amsfonts/cm/cmr7.pfb><c:/WINPROG/texl
ive/2017/texmf-dist/fonts/type1/public/amsfonts/cm/cmr9.pfb><c:/WINPROG/texlive
/2017/texmf-dist/fonts/type1/public/amsfonts/cm/cmsy10.pfb><c:/WINPROG/texlive/
2017/texmf-dist/fonts/type1/public/amsfonts/cm/cmsy6.pfb><c:/WINPROG/texlive/20
17/texmf-dist/fonts/type1/public/amsfonts/cm/cmsy9.pfb><c:/WINPROG/texlive/2017
/texmf-dist/fonts/type1/public/cm-super/sfbi0900.pfb><c:/WINPROG/texlive/2017/t
exmf-dist/fonts/type1/public/cm-super/sfbi1000.pfb><c:/WINPROG/texlive/2017/tex
mf-dist/fonts/type1/public/cm-super/sfbx0900.pfb><c:/WINPROG/texlive/2017/texmf
-dist/fonts/type1/public/cm-super/sfbx1000.pfb><c:/WINPROG/texlive/2017/texmf-d
ist/fonts/type1/public/cm-super/sfbx1200.pfb><c:/WINPROG/texlive/2017/texmf-dis
t/fonts/type1/public/cm-super/sfcc0900.pfb><c:/WINPROG/texlive/2017/texmf-dist/
fonts/type1/public/cm-super/sfrm0900.pfb><c:/WINPROG/texlive/2017/texmf-dist/fo
nts/type1/public/cm-super/sfrm1000.pfb><c:/WINPROG/texlive/2017/texmf-dist/font
s/type1/public/cm-super/sfrm1200.pfb><c:/WINPROG/texlive/2017/texmf-dist/fonts/
type1/public/cm-super/sfti0900.pfb>
Really I found that cm-super package was not installed. I've installed it now (by MikTeX console) but I do not see any changes. In particular, the line in the pdflatex log is still

Code: Select all

<C:\Users\v\AppData\Local\MiKTeX\2.9\fonts\pk\ljfour\lh\lh-t2a\dpi600\larm1000
.pk><C:/Program Files/MiKTeX 2.9/fonts/type1/public/amsfonts/cm/cmr10.pfb>
May be, I need updating some MikTex database to switch on the changes?
Post Reply