bug#41958: ps-print-buffer only knows about some fonts for MacOS Preview

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

bug#41958: ps-print-buffer only knows about some fonts for MacOS Preview

Emacs - Bugs mailing list

I use ps-print to produce a PostScript file that I open in MacOS Preview to
double-check before printing.  I'd like to be able to use Hack as a font
rather than Courier.  Right now, Hack isn't recognized along with other
installed fonts, but I can't tell why some work and some don't.


Following the directions in ps-print.el, I tried to add Hack as
a Courier replacement.  I removed the comment and updated this line:

3 cm 20 cm moveto  10/Hack-Regular ReportFontInfo  showpage

Opening the resulting PostScript file in Preview.app gives this error:


PostScript Conversion Warning

Converting the PostScript file "temp.ps" produced the following
warnings: "Hack-Regular" not found, using Courier.


Similarly for "Hack" or "Hack-Italic."  In trying to debug the problem,
I checked fonts on my laptop at random to see if any worked.
AmericanTypewriter-Light works fine while AmericanTypewriter gives the
same error, even though both are in the same directory and seem to be
otherwise similar.  I'll paste the details of those two fonts below, but
I think there must be something in the PostScript generated by ps-print
that doesn't load all the fonts.  Pages, for example, generates
a PostScript file with Hack, but it looks remarkably different than what
ps-print generates--so I'm not entirely sure what to compare.

I'm not sure what to do next to debug this: my PostScript knowledge is
minimal.  Does anyone have a sense of how to figure this out?


Emacs 26.3
MacOS 10.15.5
ps-print.el 7.3.5

Font details from Font Book:

WORKING as "AmericanTypewriter-Light":

PostScript name AmericanTypewriter-Light
        Full name American Typewriter Light
        Family American Typewriter
        Style Light
        Kind TrueType
        Language Afrikaans, Albanian, Asturian, Asu, Azerbaijani, Basque, Belarusian, Bemba, Bena, Bosnian, Breton, Bulgarian, Catalan, Chiga, Colognian, Cornish, Croatian, Czech, Danish, Dutch, Embu, English, Esperanto, Estonian, Faroese, Filipino, Finnish, French, Friulian, Galician, Ganda, German, Greek, Gusii, Hawaiian, Hungarian, Icelandic, Igbo, Inari Sami, Indonesian, Irish, Italian, Jola-Fonyi, Kabuverdianu, Kalaallisut, Kalenjin, Kamba, Kazakh, Kikuyu, Kinyarwanda, Lakota, Latvian, Lithuanian, Lower Sorbian, Luo, Luxembourgish, Luyia, Macedonian, Machame, Makhuwa-Meetto, Makonde, Malagasy, Malay, Maltese, Manx, Meru, Meta=CA=BC, Mongolian, Morisyen, North Ndebele, Northern Sami, Norwegian Bokm=C3=A5l, Norwegian Nynorsk, Nyankole, Oromo, Ossetic, Polish, Portuguese, Quechua, Romanian, Romansh, Rombo, Rundi, Russian, Rwa, Samburu, Sango, Sangu, Scottish Gaelic, Sena, Serbian, Shambala, Shona, Slovak, Slovenian, Soga, Somali, Spanish, Swahili, Swedish, Swiss German, Taita, Tajik, Teso, Tongan, Turkish, Turkmen, Ukrainian, Upper Sorbian, Uzbek, Vietnamese, Vunjo, Walser, Welsh, Western Frisian, Yoruba, Zulu
        Script Cyrillic, Greek, Latin, Tagalog
        Version 13.0d1e4
        Location /System/Library/Fonts/Supplemental/AmericanTypewriter.ttc
        Unique name American Typewriter Light; 13.0d1e4; 2017-06-07
        Copyright Digitized data (c) Copyright 1997 E+F Designstudios. ITC American Typewriter is a registered trademark of International Typeface Corporation.
        Trademark ITC American Typewriter is a registered trademark of International Typeface Corporation.
        Enabled Yes
        Duplicate No
        Copy protected No
        Glyph count 1,195

GIVES ERROR as "AmericanTypewriter":

PostScript name AmericanTypewriter
        Full name American Typewriter
        Family American Typewriter
        Style Regular
        Kind TrueType
        Language Afrikaans, Albanian, Asturian, Asu, Azerbaijani, Basque, Belarusian, Bemba, Bena, Bosnian, Breton, Bulgarian, Catalan, Chiga, Colognian, Cornish, Croatian, Czech, Danish, Dutch, Embu, English, Esperanto, Estonian, Faroese, Filipino, Finnish, French, Friulian, Galician, Ganda, German, Greek, Gusii, Hawaiian, Hungarian, Icelandic, Igbo, Inari Sami, Indonesian, Irish, Italian, Jola-Fonyi, Kabuverdianu, Kalaallisut, Kalenjin, Kamba, Kazakh, Kikuyu, Kinyarwanda, Lakota, Latvian, Lithuanian, Lower Sorbian, Luo, Luxembourgish, Luyia, Macedonian, Machame, Makhuwa-Meetto, Makonde, Malagasy, Malay, Maltese, Manx, Meru, Meta=CA=BC, Mongolian, Morisyen, North Ndebele, Northern Sami, Norwegian Bokm=C3=A5l, Norwegian Nynorsk, Nyankole, Oromo, Ossetic, Polish, Portuguese, Quechua, Romanian, Romansh, Rombo, Rundi, Russian, Rwa, Samburu, Sango, Sangu, Scottish Gaelic, Sena, Serbian, Shambala, Snhona, Slovak, Slovenian, Soga, Somali, Spanish, Swahili, Swedish, Swiss German, Taita, Tajik, Teso, Tongan, Turkish, Turkmen, Ukrainian, Upper Sorbian, Uzbek, Vietnamese, Vunjo, Walser, Welsh, Western Frisian, Yoruba, Zulu
        Script Cyrillic, Greek, Latin, Tagalog
        Version 13.0d1e4
        Location /System/Library/Fonts/Supplemental/AmericanTypewriter.ttc
        Unique name American Typewriter; 13.0d1e4; 2017-06-07
        Copyright Digitized data (c) Copyright 1997 E+F Designstudios. ITC American Typewriter is a registered trademark of International Typeface Corporation.
        Trademark ITC American Typewriter is a registered trademark of International Typeface Corporation.
        Enabled Yes
        Duplicate No
        Copy protected No
        Glyph count 1,195


Respectfully submitted,
-James

--
James P. Ascher
Doctoral Student, English Department
University of Virginia




Reply | Threaded
Open this post in threaded view
|

bug#41958: ps-print-buffer only knows about some fonts for MacOS Preview

Mattias Engdegård-2
Is this really an error in what Emacs emits? My PostScript is incredibly rusty, but with the PS font name reported by Font Book, it seems to work for me. I wrote a .ps file by hand:

------------- start of file -------
%!
/AmericanTypewriter findfont 12 scalefont setfont
100 400 moveto
(Hello! I'm AmericanTypewriter!) show
showpage
-------------- end of file --------

and it was accepted by Preview in macOS Mojave. American-typewriter-Light worked just as well, and in both cases the correct font was used. I don't have your Hack font installed, however.




Reply | Threaded
Open this post in threaded view
|

bug#41958: ps-print-buffer only knows about some fonts for MacOS Preview

Emacs - Bugs mailing list
> Is this really an error in what Emacs emits?

Your example shows it is not an Emacs bug and should be closed here.
Thank you!

This appears to be a setup-dependent MacOS bug, which I've sent that
way the best I know how: https://discussions.apple.com/thread/251495268  and  Feedback FB7744710




Reply | Threaded
Open this post in threaded view
|

bug#41958: ps-print-buffer only knows about some fonts for MacOS Preview

Mattias Engdegård-2
tags 41958 notabug
close 41958
done

21 juni 2020 kl. 11.22 skrev James P. Ascher <[hidden email]>:

> Your example shows it is not an Emacs bug and should be closed here.

Thank you, and best of luck. Do tell us if anything Emacs-specific turns up.