32
11
lots of cut text in the server while the files are exported fine in your development machines,
this is probably the cause.
The solution for this problem is easy; make sure you have all the fonts you use installed in
n
your system. If you want to get notified whenever this automatic font replace happens,
you can catch the “FlexCelError.PdfFontNotFound” errors in FlexCelTrace, and use it to
notify the user he should install the missing fonts.
Problem 2: Missing Glyphs
This problem happens when you are using a font that doesn't contain the character you
want to display. If you for example write
“日本 に行きたい。”
inside a cell and keep the font “Arial”, you will see the correct characters in Excel, but
when exporting you might see blank squares like this:
The reason for this is that “Arial” doesn't actually contain Japanese characters, and Excel is
“under the hood” using other font (normally MS Mincho) to display the characters. To
emulate this behavior, FlexCel provides a “FallbackFonts” property, where you can enter a
list of fonts to try if the font that was supposed to be used doesn't have the character. If no
font in the FallbackFont chain contains the glyph, you will see a blank square.
The solution in this case is to use fonts that actually have the characters you want to
display, or ensure that some fonts in the FallbackFonts properties have them. By default
t
FlexCel uses “Arial Unicode MT” as a fallback font, but you can add as many others as you
need.
If you want to get notified when this happens so you can warn the user to change the
he
fonts, you can catch the “FlexCelError.PdfGlyphNotInFont” and
“FlexCelError.PdfUsedFallbackFont” errors in FlexCelTrace.
Problem 3: Faux Italics and Bolds
The last problem is related to fonts that don't have a specific “Italic” or “Bold” variant.
Normally, a quality font comes with four files including four variants of the font: Bold, Italic
and BoldItalic. If you look in your font folder, you will see things like this: