Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I display a Unicode character using Apache fop? Showing "?" instead of character.

I been trying to insert a Unicode character ∇ or ▽, so it shows in the PDF generated by Apache FOP.

This is what I did so far:

  1. First you have to know the correct Unicode codepoint to represent the character according to this basic help Apache XSL-FO Input, that Unicode codepoint can be found in unicode.org inside a list of Mathematical Operators. The code is ∇ ∇ NABLA, I could also use ▽ ▽ a down-pointing triangle.

  2. After finding the correct code I have to select a font containing the necessary glyph and the Adobe PostScript and PDF Specification specify Base-14 Font Character Mapping that must be available to every PostScript interpreter and PDF reader, so I search in the list and the font Symbol contains ∇&#x2207, (no font contains▽▽ discarded)

  3. After that search the result code I think I should use in xsl:fo is:

     <fo:block font-family="Symbol">
     &#x2207;
     </fo:block>
    
  4. The problem is when it generates the PDF, the result is not what I expected "∇", but instead of that it shows a "?", I read that when it can't show the character usually shows "#", but my code is showing "?".

  5. I'm using Apache fop 0.95, I suspect is that version which is causing the problem, and I should update to 1.0, but at the moment that's the version used in production, and the team leader said it's difficult at the moment to upgrade it.

So there that is the problem, could be something else besides the version? Could be something dummie I forgot to do? How can I display a Unicode character using Apache fop?

like image 317
Juan Marcos Avatar asked Nov 02 '11 15:11

Juan Marcos


People also ask

Why do some Unicode characters not show up?

If you are unable to read some Unicode characters in your browser, it may be because your system is not properly configured. Here are some basic instructions for doing that. There are two basic steps: Install fonts that cover the characters you need.

How do I display Unicode?

To insert a Unicode character, type the character code, press ALT, and then press X. For example, to type a dollar symbol ($), type 0024, press ALT, and then press X. For more Unicode character codes, see Unicode character code charts by script.

How do I use Unicode characters in XML?

Characters are denoted using the notation used in the Unicode Standard, that is, an optional U+ followed by their hexadecimal number, using at least 4 digits, such as "U+1234" or "U+10FFFD". In XML or HTML this could be expressed as "&#x1234;" or "&#x10FFFD;".

Is Unicode a character code?

Unicode is an International character encoding standard that includes different languages, scripts and symbols. Each letter, digit or symbol has its own unique Unicode value. Unicode is an extension of ASCII that allows many more characters to be represented.


1 Answers

Try with the decimal value of the symbol (I think you don't need the Symbol font family for this):

&#8711;

For everyone who need to know the values of special symbols, you can find them here

like image 140
luchoct Avatar answered Oct 13 '22 11:10

luchoct