diogo-fernan / academicons

LaTeX academicons package for high qual­ity icons of on­line aca­demic pro­files.
https://www.ctan.org/pkg/academicons
60 stars 16 forks source link

Font "Academicons" does not contain any OpenType `Script' information #6

Closed JeffreyRacine closed 6 years ago

JeffreyRacine commented 6 years ago

Greetings,

First, thanks for writing this excellent package.

I am using the latest version of texlive on macOS 10.13.5. It surfaces with either the mactex distribution or the macports distribution. I am able to replicate on two other computers.

I am running into an issue that I hope you might be able to resolve. The same issue exists with the package fontawesome however it is not present in the package fontawseome5 which works flawlessly so perhaps that will help diagnose.

The issue is as follows (from the log file):

Package: academicons 2018/04/16 v1.8.6 Academicons Icons (save: /Users/jracine/.texlive2017/texmf-var/luatex-cache/generic/fonts/otl/acad emicons.lua)(save: /Users/jracine/.texlive2017/texmf-var/luatex-cache/generic/fo nts/otl/academicons.luc) luaotfload | aux : font no 18 (nil) defines no feature for script latn luaotfload | aux : no font with id 18 ................................................. . fontspec info: "no-scripts" . . Font "Academicons" does not contain any OpenType `Script' information. ................................................. ! Undefined control sequence.

\LaTeX3 error: Invalid operation fp_to_decimal(inf) l.12 \newfontfamily{\AI}{Academicons} I am using the following packages (actually, pandoc is rendering the R Markdown file and adds many of these packages) \usepackage{lmodern} \usepackage{amssymb,amsmath} \usepackage{ifxetex,ifluatex} \usepackage{fixltx2e} % provides \textsubscript \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage{mathspec} \usepackage{fontspec} \IfFileExists{upquote.sty}{\usepackage{upquote}}{} \usepackage{microtype} \usepackage[margin=1in]{geometry} \usepackage{hyperref} \usepackage{longtable,booktabs} \usepackage{graphicx,grffile} \usepackage{parskip} \usepackage{titling} \usepackage{academicons} The issue appears to be with the use of Scale and fontspec... if I manually remove Scale=MatchLowercase then the file is processed, otherwise it throws this error. \defaultfontfeatures{Ligatures=TeX,Scale=MatchLowercase} Given that fontawesome5 is able to overcome this issue I was hoping that perhaps you might be able to apply a patch. Thanks again! The file generated from pandoc is attached with a .txt extension (would not accept .tex extension) [vitae.txt](https://github.com/diogo-fernan/academicons/files/2129928/vitae.txt)
diogo-fernan commented 6 years ago

Hey Jeffrey,

It appears that the issue might be related with the lack of an OpenType Font (OTF) file from the academicons font, which is not the case with fontawesome5 that ships with an *.otf file. This can be seen in tufontawesomebrands.fd:

\DeclareFontShape{TU}{fontawesomebrands}{regular}{n}
  {<-> \UnicodeFontFile{FontAwesome5Brands-Regular-400.otf}{script=latn;}}{}

I will try to address this in the coming days.

Cheers, Diogo

JeffreyRacine commented 6 years ago

Thanks for your kind response. It would be great to have this resolved, and accept my gratitude in advance. Best of luck!

zauguin commented 6 years ago

Hey, I am the maintainer of fontawesome5. The problem is that the defaultfontfeatures apply to Academicons, but they do not make any sense there: There are no lowercase characters, so their scale can not be matched. I think fontspec should ignore MatchLowercase here, so this might be a fontspec bug. The fontawesome5 package avoids this by not using fontspec. This should be possible even if "only" a ttf file is available, so if @diogo-fernan is interested I could write a Pull-Request to replace fontspec with a .fd file tomorrow.

In the short term @JeffreyRacine could probably fix the problem by moving \usepackage{academicons} before \defaultfontfeatures{Ligatures=TeX,Scale=MatchLowercase}.

JeffreyRacine commented 6 years ago

Thanks for taking the time to look into this. I am using R Markdown and pandoc which automatically generates the placement of \usepackage{}, so your helpful suggestion works if I manually edit the LaTeX file that is created by pandoc... anything you can do is most appreciated to resolve the issue...

diogo-fernan commented 6 years ago

Feel free to make a pull request @zauguin :-)

Thanks!

Diogo