Prevent LocalReport.Render using Calibri Font Ligatures
Asked Answered
G

3

12

I'm having an issue with an RDLC report printing empty characters when produced as a PDF. It only affects font ligatures which I understand to be letter combinations such as:

  • ti
  • ft
  • fi
  • tt

My research shows these character combinations are combined into a single glyph, which I see as an empty space when printed out. Example clippings:

On PDF:

enter image description here

enter image description here

Printed:

enter image description here

enter image description here

Therefore the symptoms are:

  • The PDF appears fine on the screen
  • When printed (physically or using the XPS writer) all ligatures appear as a blank space

So far I have narrowed it down to a particular font (Calibri) and a particular server (Windows Server 2003 R2). The PDF has the font embedded:

enter image description here

I order to resolve this I'd be happy with:

  • Prevent LocalReport.Render from combining ligatures
  • Enable Server 2003 to treat the font as my Windows 7 machine is

I'm not sure how / where I would begin in comparing the font environments, therefore ideas and pointers are much appreciated.

UPDATE:

Thanks to the answers below I have checked the charmaps on both machines but they look identical:

Server (where issue lies):

enter image description here

Local (no issue):

enter image description here

This also reminded me that I installed the font by copying over the font files and installing them directly. Both versions are 5.72, Digitally Signed, TrueType Outlines, however the server displays OpenType Font whereas local displays OpenType Layout (could just be different operating system display).

An interesting point is if I use Calibri Regular 48 locally I see the ligature:

enter image description here

whereas the server doesn't use it:

enter image description here

In addition both PDFs are PRINTED on the same machine, but it's only the PDF generated on the server that exhibits the issue, therefore I think printer drivers cannot be the issue?

Gobble answered 25/11, 2013 at 12:27 Comment(14)
Here Calibri's missing tt is specifically mentioned. It looks like, regardless of font being embedded into PDF, local 2003 installed copy is used. Upgrading font version at 2003 machine and/or making it always use embedded font (printer driver options?) is best solution. If you only control computer that generates PDFs, maybe downgrading Calibri there is an option.Solarism
@VadimR - It looks like both fonts contain the the same ligatures (not tt or ti as you say) but this wouldn't explain why I'm seeing ti and tt being omitted on one machine not the other.Gobble
Can you provide a sample PDF and point out which ligatures exactly are missing in the printout, e.g. by means of a scan of the printout?Ecesis
@Ecesis - I don't think I can give you whole pages since these are invoices, however I've updated the question with subsections that are displaying the issue. As an aside I can replicate this without having to physically print by using the Microsoft XPS Document WriterGobble
PDFs already do contain ligatures, can you zoom in and make sure? +I'd check exact font versions on both machines, MS has many of them. Try installing latest (or some other?) version all over. Where I'm now, Calibri is 1.02, charmap shows smaller ligatures list, also without tt & ti. But in Fontforge I see these glyphs present, though strangely without Unicode assigned. Don't know if it's OK with font licenses, I'd quickly regenerate fonts omitting these things and install new font here, there or both and see if it helps.Solarism
I'm not sure about the "Section 1" clip but the "Helpful Information" clip looks somewhat bold. Are you sure that while copying over the font files you copied all Calibri related font files?Ecesis
@VadimR - I've just zoomed in on the PDF and the characters that go missing don't actually connect (they just look like normal characters), therefore I'm not sure they are ligatures at all? I've modified my question to show the PDF version. Is that link the latest version? I can't see how to check the installed version, but it does appear I have all fonts/files (and a handful more such as Calibri Light).Gobble
@Ecesis - You're right, it is bold. Having checked the files it seems I have all and some extras.Gobble
No ligature in PDF. Maybe someone (something), application or printer driver, tries to be smart and create ligature while printing, but fails. What information it tries to find in embedded or system font version, and if there's versions' conflict, is unclear. I see font version on both double-clicking (view sample) or right-clicking (view properties) the font file, but here today is outdated XP machine, should be similar on 7. If you'll try replacing versions, I think reboot will be needed, + check version wasn't restored (from some cache or installation files) after that.Solarism
If I write "Information" in Notepad (with Calibri Bold), ligature is created on the fly and written to postscript or XPS (10 glyphs) correctly.Solarism
@VadimR - I can see the version now, both are 5.72 OpenType Digitally Signed. Interestingly using notepad on the server doesn't render the ligature. I've updated the question.Gobble
What if you temporarily remove all of Calibri from server, reboot and try to print PDF?Solarism
Re: no ligatures in Notepad. Is Uniscribe USP10.dll properly installed and enabled, appropriate version? Latin ligatures, amongst other things, are what this service handles.There was recent security patch, I hope they didn't break anything with it. This mentions restricting access to dll, it may be the issue.Solarism
Some more info on UniScribe here superuser.com/questions/375449/… The comment by afrazier there looks like something you could try and set on the server.Biron
S
4

Can you do a search and replace and break the ligatures by inserting between the characters a word joiner character (U+2060) or on older systems, with a zero width no break space (U+FEFF)? This should force it not to use ligatures.

Sinistrality answered 2/12, 2013 at 19:42 Comment(0)
F
1

In general, PDFs generated by ReportViewer and even from Reporting Services won't embed fonts:

The PDF rendering extension does not embed fonts. Fonts that are used in the report must be installed on the report server and on the client computers used to view the report.

Thus I would:

  1. Check that the Calibrì font version in the 2003 server is the same present in the client (browse to %windir%\fonts in the two machines, click Calibrì, right-click each ttf file, select Properties and look for File version in the Details tab).
  2. Fix differences: delete the older version from the 2003 server and import the new ttf that you find in the windows 7 one, all using the tool provided by the os (see the picture below) tool provided by the os
  3. Try your process again: if you get what you need, you have done.
  4. If you actually need to distribute the produced reports to clients that could have the same issue, you have to install GhostScript and to post-process your pdfs with something like the following (that will produce a PDF/A output file)
gs -dPDFA -dBATCH -dNOPAUSE -dUseCIEColor -dHaveTransparency=false -sProcessColorModel=DeviceCMYK -sDEVICE=pdfwrite -sPDFACompatibilityPolicy=1 -sOutputFile=output_filename.pdf input_filename.pdf

A few side notes:

  • in the past I had similar issues with custom fonts that disappear after rebooting the server, thus after step 2 try to reboot the server before proceeding
  • GhostScript is a venerable free software, double-licensed under Affero GNU/General Public Licence (suitable only for open source projects using the same license) and under the Artifex Commercial License for everybody else. Here you can find details.
  • In the past I've been asked to try a lot of cheaper alternatives to GhostScript, and believe me: there's no cheaper alternative that works.
Forsythe answered 3/12, 2013 at 12:8 Comment(0)
S
0

There is a solution, if you have access to the font definition (in the code).

xaml: FontFamily="Calibri" Typography.StandardLigatures="False"

Speculator answered 14/9, 2021 at 8:27 Comment(1)
Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.Yeast

© 2022 - 2024 — McMap. All rights reserved.