You are not logged in.

#1 2022-11-07 07:36:46

neoabc123
Member
Registered: 2022-09-25
Posts: 52

[SOLVED]using different font substitute in pdfs

I have pdf which uses windows fonts,but okular/firefox etc. use notofonts for text inside inside instead of liberation or gnu-fonts which provide better appearence.How do i change this

Last edited by neoabc123 (2022-11-07 16:21:11)

Offline

#2 2022-11-07 08:20:06

neoabc123
Member
Registered: 2022-09-25
Posts: 52

Re: [SOLVED]using different font substitute in pdfs

Don't know why but installing xpdf fixed this in poppler based pdfs

Offline

#3 2022-11-07 08:20:40

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,207

Re: [SOLVED]using different font substitute in pdfs

https://wiki.archlinux.org/title/Metric … figuration
symlinking /usr/share/fontconfig/conf.avail/30-metric-aliases.conf into /usr/share/fontconfig/conf.default should do - and be in place.

fc-match Arial

Are we sure the pdf actually "uses window fonts"? And what "windows fonts"? And why are they not embedded?

Edit: probably though an (unrelated?) config from https://archlinux.org/packages/extra/any/gsfonts/ ?
Did you have that package before?

Last edited by seth (2022-11-07 08:22:26)

Offline

#4 2022-11-07 08:32:50

neoabc123
Member
Registered: 2022-09-25
Posts: 52

Re: [SOLVED]using different font substitute in pdfs

yes it uses windows fonts eg timesNewRomanPSMT etc. i found in okular file properties that these were substituted with noto-fonts and only a few were embedded.

sudo ln -sf  /usr/share/fontconfig/conf.avail/30-metric-aliases.conf /usr/share/fontconfig/conf.default

doesn't fix

fc-match arial
LiberationSans-Regular.ttf: "Liberation Sans" "Regular"

xpdf installed with gs-fonts that probably fixed something.

edit: no didnt have earlier{didn't saw your edit}

Last edited by neoabc123 (2022-11-07 08:36:27)

Offline

#5 2022-11-07 09:03:58

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,207

Re: [SOLVED]using different font substitute in pdfs

Compare

fc-match "Times New Roman"
fc-match Arial

w/ and w/o gsfonts.

Offline

#6 2022-11-07 09:29:31

neoabc123
Member
Registered: 2022-09-25
Posts: 52

Re: [SOLVED]using different font substitute in pdfs

the same output

Last edited by neoabc123 (2022-11-07 09:29:48)

Offline

#7 2022-11-07 09:33:29

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,207

Re: [SOLVED]using different font substitute in pdfs

… being?

Offline

#8 2022-11-07 10:55:20

neoabc123
Member
Registered: 2022-09-25
Posts: 52

Re: [SOLVED]using different font substitute in pdfs

$ fc-match "Times New Roman"
LiberationSerif-Regular.ttf: "Liberation Serif" "Regular"
$ fc-match Arial
LiberationSans-Regular.ttf: "Liberation Sans" "Regular"

Offline

#9 2022-11-07 13:13:27

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,207

Re: [SOLVED]using different font substitute in pdfs

That would suggest that fontconfig correctly resolves the Liberation fonts, but "okular/firefox etc." do not?
Does

pdffonts -subst file.pdf

sow different results depending on the presence of gsfonts?

Offline

#10 2022-11-07 13:35:36

neoabc123
Member
Registered: 2022-09-25
Posts: 52

Re: [SOLVED]using different font substitute in pdfs

same output

name                                 object ID substitute font                      substitute font file
------------------------------------ --------- ------------------------------------ ------------------------------------
TimesNewRomanPS-BoldMT                  157  0 Noto Sans Bold                       /usr/share/fonts/noto/NotoSans-Bold.ttf
TimesNewRomanPSMT                       160  0 Noto Sans Regular                    /usr/share/fonts/noto/NotoSans-Regular.ttf
TimesNewRomanPS-BoldItalicMT            163  0 Noto Sans Bold Italic                /usr/share/fonts/noto/NotoSans-BoldItalic.ttf
TimesNewRomanPS-ItalicMT                166  0 Noto Sans Italic                     /usr/share/fonts/noto/NotoSans-Italic.ttf
ArialMT                                 181  0 Noto Sans Regular                    /usr/share/fonts/noto/NotoSans-Regular.ttf

Last edited by neoabc123 (2022-11-07 13:36:31)

Offline

#11 2022-11-07 14:02:49

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,207

Re: [SOLVED]using different font substitute in pdfs

So to summarize:
Regardless of gsfonts fontconfig resolves the desired Liberation for while poppler *regardlessly!* substitutes Noto.
But installing gsfonts changes the behavior of poppler???

Try mupdf/llpp…

Offline

#12 2022-11-07 14:29:39

neoabc123
Member
Registered: 2022-09-25
Posts: 52

Re: [SOLVED]using different font substitute in pdfs

yes strange.Without gs fonts it renders incorrectly

Mupdf works fine even without gsfonts.

Offline

#13 2022-11-07 16:03:26

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,207

Re: [SOLVED]using different font substitute in pdfs

https://gitlab.freedesktop.org/poppler/ … issues/819
The problem will be that "TimesNewRomanPS" is different from "Times New Roman".

Offline

#14 2022-11-08 01:38:58

neoabc123
Member
Registered: 2022-09-25
Posts: 52

Re: [SOLVED]using different font substitute in pdfs

Thanks

Offline

Board footer

Powered by FluxBB