Why are my TrueType hints ignored? - pdf-generation

I have integrated some hints (a prep handler to update the cvt and glyph instructions (simple MIAPs to copy the cvt values to specific points) into a custom TTF font.
I changed the fonts via Python fontTools.ttx
The font and the hints work perfectly when I test the font in TrueTypeViewerQt.
The font (and the hints) work also in PIL.
I can also see the hints in FontForge (for prep and the glyphs), but debugging them just shows "".
I also get this message in the console window:
SplineFontPieceMeal() going unhinted...
When I now use the font from a PDF file (written via reportlab), the font is used, but my hints seem to be ignored by Acrobat Reader, Ghostscript, mudraw, Chrome Web Browser (integrated PDF view), or an own application based on PDFium.
Then font exported from the PDF (via mutool) still contains the hints which work in TrueTypeViewerQt.
PDF: https://www.dropbox.com/s/qn3iooazsq1z2w5/d85.pdf?dl=0
Font: https://www.dropbox.com/s/p6qwug9h6vcgps0/testbar.ttf?dl=0
Any ideas?

Related

Ghostscript PDF fonts becomes boxes in Adobe Illustrator where as its output is fine when opened in Adobe Acrobat

I need to convert the PDF of RGB color space to Grayscale using commandline tool supporting for Windows and Linux.
When i used Ghostscript the conversion is happening but when the output is opened in illustrator the fonts were shown as boxes.
Is there any solution option available in Ghostscript to overcome this font issue.
Is there any other commandline tool available for this conversion.
The font encoding is always built in is there any ways available to change it as ANSI encoding.Screenshot of font issue on illustrator VS the working scenario on acrobat
Pictures of the problem really don't help. You need to provide the following:
The version of Ghostscript you are using, and the platform (Linux, Windows etc), the word size of the version of Ghostscript and where you sourced this version of Ghostscript from (official Ghostscript download page, package, self-built binary).
An example file to reproduce the problem
The exact command line you used to reproduce the problem, and any supporting files required.
I suspect that your problem is that the original PDF file does not include the fonts that it uses, and that you have left SubsetFonts as true, and have left the AlwaysEmbed and NeverEmbed arrays untouched. This will mean that the new PDF file also does not include the fonts, which means that any PDF consumer must use a substitute font. The 'boxes' you refer to are /.notdef glyphs which are used when the font does not contain the glyph being requested.
Having the Encoding 'built-in' doesn't help with anything at all, it's the presence or absence of the fonts which matters. No, you can't change the encoding to 'ANSI', if you do that (assuming it isn't already WinAnsiEncoding) you'll see very similar problems to the ones you are complaining of here. You would also need to change the text character codes in the PDF file to be able to change the Encoding.
You could also raise this as a bug at https://bugs.ghostscript.com, where you will also have to supply an example file (as simple as possible) and all the other information listed above.

Inconsolata font on Android Studio

I want to use Inconsolata font on a intelliJ editor (Android Studio) on Windows but it looks messy.
I managed to load inconsolata by adding some antialiasing options on studio.exe.vmoptions. I just added these options
-Dawt.useSystemAAFontSettings=on
-Dswing.aatext=true
-Dsun.java2d.xrender=true
and now the font loads but it looks too much crappy to use. Actually any font on this ide looks crappy. Here's a screenshot of the same font on SublimeText right and on Android Studio left
Anyone knows if you can use this font on intelliJ based editors or if there are some issues associated with this font?
We can simply use google fonts It's very easy to implements. only you have to follow these steps.
step 1) Open layout.xml of your project and the select font family of text view in attributes (for reference screen shot is attached)
step 2) The in font family select More fonts.. option if your font is not there. then you will see a new window will open, there you can type your required font & select the desired font from that list i.e) Regular, Bold, Italic etc.. as shown in below image.
step 3) Then you will observe a font folder will be auto generated in /res folder having your selected fonts xml file
Then you can directly use this font family in xml as
android:fontFamily="#font/inconsolata"

Opentype font not being used in Silverlight Windows Phone 7 app on deploy

Is there a way to use an OpenType font on Windows Phone 7 Silverlight application? I want to use Lobster which is only available AFAIK in OpenType format. It renders in Blend but not when I deploy to the emulator.
I have included the .otf file in my project and set the Properties to 'Content' and 'Copy If Newer'.
This website found a solution for .ttf fonts, but the technique specified does not work for OpenType. Is OpenType not supported by Windows Phone? I find this hard to believe given that MS part invented the format!
Windows Phone requires your fonts to be TrueType (.ttf). OpenType (.otf) is not supported.
There may be some confusion on the term "OpenType". OpenType is a broad description of the format which actually includes 2 "flavors" for describing the font's outlines: TrueType and CFF (A form of Adobe PostScript).
A font with a .otf extension is most definitely an OpenType font, and usually means that it includes CFF outlines.
But a TrueType font is, in most cases, generally considered an OpenType font as well, since the OpenType format is actually a superset of both TrueType and CFF flavors.
Regarding Lobster in particular: as a test, I added that font to my Google Webfonts collection, and clicked "Download Collection". The resulting file was a .ttf, and as such, should be usable in Windows Phone as Den Delimarsky's answer points out. How are you getting a .otf version of this file? And is it truly a CFF file, or just a TrueType file with a .otf extension?
Also note that you may be able to obtain the TrueType/.TTF directly from the Google Font Directory though doing so through a browser currently seems to be a bit wonky.
you need to add it to the project, set build action to content and enter a uri that links to it in the FontFamily property with the hash tag:
Example of FontFamily:
FontFamily="fonts/Lobster.ttf#Lobster"

Cannot extract the embedded font - Code Igniter and dompdf

Following the instruction in this link ( https://github.com/EllisLab/CodeIgniter/wiki/PDF-generation-using-dompdf ), I always encounter an error when opening the pdf file created. The error message is:"Cannot extract embedded font 'TradeGothicLT-CondEighteen'.Some characters may not display or print correctly. " and when i click OK, the pdf displays black background and when i start highlighting the body, it captures the text but text are in black font-color. what should I do to get rid of this error?
There may be something wrong with your font cache, located at dompdf/lib/fonts/dompdf_font_family_cache.php (though the exact file name depends on your release and whether you have loaded fonts). This file tells dompdf what fonts are available for use in the PDF. If this file references a font that isn't actually available you can run into major issues on viewing. You may need to re-load your font files. Take a look at the Unicode how-to for an overview of using embedded fonts. This document hasn't been updated to reflect changes implemented in dompdf 0.6.0 beta 3, but the information is still pertinent.

How do you reliably render Khmer (Indic) fonts on the web (and in PDFs)?

I've been having a world of trouble getting Khmer fonts (an Indic script of Cambodia) to render reliably on the web across platforms (Mac, Windows, Linux).
Google web fonts recently added Khmer, which seems like the best bet. However, I have not been successful getting Khmer fonts to work on any Mac or Linux system. I can get them to work on Windows by installing the Khmer Unicode installer from http://khmeros.info but not by just including Google's font in an HTML file.
For example, see this screenshot of the Google web fonts page on a fresh Windows installation. You can see that the default Windows Khmer font (uuuuugly!) is being used instead of Danh's pretty fonts.
I have another test file here: http://dl.dropbox.com/u/634/khmer_test.html. For the first test, you should see something like this for both the web font and the default system font (assuming you have Hanuman installed). I have yet to find a system where both examples work reliably.
Any help would be greatly appreciated. My primary goal is to get this working on a website; a secondary goal is to get Khmer (and other Indic fonts) working in a PDF generator like iText (although I am aware iText itself does not support Indic fonts -- I'm hoping something similar does).
Every Cambodian Windows users are always delete the font name called: KhmerMool and Khmer Kampot. Then they change the default Khmer font in regedit too. You can check at http://thelifeandwork.blogspot.com/2010/01/changing-default-khmer-font-in-windows.html . I'm not sure about Khmer font and other Indic font in PDF. I always have problem when i copy Khmer unicode from PDF to put in OpenOffice or Office Word or LibreOffice.
Khmer Unicode displays on the web, it will always solve now by Google Webfont, please refer to that.
And if you want to have Khmer display in PDF by converting using iText, you can see following post:
Khmer Unicode in iText
http://ask.osify.com/qa/287
They are currently not yet support the display yet.
But, just today I can get it works by modifying the source code of iText (5.5.4-SNAPSHOT) as I just stated in my post: http://ask.osify.com/qa/613, not yet be able to publish since it's just start in testing around.
Updated 13/01/2016
I have added the source code sample for the rendering: http://ask.osify.com/qa/613
The rendering customization with iText for Khmer Unicode added in github: https://github.com/Seuksa/iTextKhmer

Resources