LaTeX forum ⇒ MiKTeX and proTeXtMiktex and fontspec Topic is solved

Information and discussion about MikTeX distribution for Windows and the related proTeXt: Installing, updating, configuring
Leo__
Posts: 21
Joined: Thu Oct 28, 2010 4:33 pm

Miktex and fontspec

Postby Leo__ » Mon Aug 28, 2017 11:54 am

Hello,

I am on Miktex 2.9, Windows 7 and am trying to get (new) hebrew fonts to work with polyglossia and fontspec. My pb looks very similar to that of Arieh (http://latex.org/forum/viewtopic.php?f=48&t=30122&p=101904&hilit=Arieh#p101904), except that he's on TexLive and Ubuntu.

I used cardo as the new font.

I installed the fonts in a local directory: c:/localtexf/fonts/cardo/,
and I used the specification
Path = localtexf/fonts/cardo/,
as seems recommended by the fontspec manual.

Here is a MWE:

  1. \documentclass{article}
  2. \usepackage{fontspec}
  3. \setmainfont[Path = localtexf/fonts/cardo/,
  4. UprightFont = *-Regular,
  5. ItalicFont = *-Italic,
  6. BoldFont = *-Bold]{Cardo}
  7. \usepackage{polyglossia}
  8. \setdefaultlanguage{english}
  9. \setotherlanguage{hebrew}
  10. \newfontfamily\hebrewfont[Script=Hebrew]{Cardo}
  11. \begin{document}
  12. This hebrew text is Gen.1:1 from BHS\\
  13. \RL{בְּרֵאשִׁ֖ית בָּרָ֣א אֱלֹהִ֑ים}\\ % result: misplaced vowels & diacritics
  14. \begin{hebrew}
  15. \RL{בְּרֵאשִׁ֖ית בָּרָ֣א אֱלֹהִ֑ים}
  16. \end{hebrew}\\ % result: right placed vowels & diacritics
  17. Text again.
  18. \end{document}



I get the error message:
! fontspec error: "font-not-found"
!
! The font "Cardo-Regular" cannot be found.
!
! See the fontspec documentation for further information.

If the issue is specific to Miktex (as I see that it was successfully resolved under Ubuntu with TexLive), please let me know.

Tags:

rais
Posts: 146
Joined: Sun Nov 16, 2014 8:51 pm

Postby rais » Mon Aug 28, 2017 10:53 pm

Well, according to fontspec's manual, you've reversed the positions of mandatory and optional arguments to \setmainfont...
texdoc fontspec wrote:\setmainfont{texgyrepagella}[
Path
= /Users/will/Fonts/ ,
UprightFont
= *-regular ,
BoldFont
= *-bold ,
... ]

Furthermore: where do you think ``Path = localtexf/fonts/cardo/'' leads to? Mayhap it's leading to ./localtexf/fonts/cardo---which would be underneath your (.tex) document's folder...

Perhaps you'd be better off putting the font into your Window's font folder and omit the optional argument to \setmainfont, it should be found there by XeLaTeX and friends out-of-the-box.

Personally, I'd drop the font in ~/.fonts, run `fc-cache ~/.fonts', after which I should be able to use the font using XeLaTeX (and friends).
But then, I'm under Linux, not Win$...

KR
Rainer

Arieh
Posts: 4
Joined: Wed Aug 23, 2017 3:50 pm

Postby Arieh » Tue Aug 29, 2017 10:46 am

Hello Leo__,

Try specifying the extension of the font:

  1. \setmainfont[
  2. Path = /localtexf/fonts/truetype/cardo/,
  3. UprightFont = *-Regular ,
  4. BoldFont = *-Bold ,
  5. ItalicFont = *-Italic ,
  6. Extension = .ttf
  7. ]{Cardo} %Cardo

Leo__
Posts: 21
Joined: Thu Oct 28, 2010 4:33 pm

Postby Leo__ » Sun Sep 03, 2017 4:47 pm

It works ! Thanks Arieh. But I'll try rais' suggestion nevertheless.


Return to “MiKTeX and proTeXt”

Who is online

Users browsing this forum: No registered users and 2 guests