xmlgraphics-fop-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christopher R. Maden" <cr...@maden.org>
Subject Re: How to translate characters?
Date Fri, 02 Sep 2011 17:55:36 GMT
On 09/02/2011 01:40 PM, Eric Douglas wrote:
> I pass a character into my XML/FO as &#x25A1; and it shows on the PDF
> as a square.
> I'm trying to figure out what Java has for interpreting such code,
> and it appears FOP just string searches and pulls out the number, in
> the class org.apache.xmlgraphics.fonts.Glyphs.
> Is this all it is, to search text for "&#" and ";" and find the 
> character value between, or is there an actual Java class/method for 
> translating such values?

By the time FOP gets this information, the XML has been parsed.
&#x25a1; is just a convenient way of entering the single character with
Unicode value 25A1, □, WHITE SQUARE.  Equivalents would be &#9633; or
(with common ISO entity declarations) &squ; — in all cases, FOP just
receives a single character, □.

FOP then attempts to find which of the specified fonts actually has a
glyph for that character, and does so using the numeric Unicode value of
the character, but that is independent of how the input XML (which FOP
does not see) specified the character.  If you’re looking at altering or
overriding the code, you need to operate in the character domain, not
the XML markup domain.

(By analogy, FOP receives elements, root-in-the-FO-namespace etc., not
the string “<fo:root ...”.  This is the same kind of thing.)

~Chris
-- 
Chris Maden, text nerd  <URL: http://crism.maden.org/ >
“The present tendency and drift towards the Police State gives all
 free Americans pause.” — Alabama Supreme Court, 1955
 (Pike v. Southern Bell Tel. & Telegraph, 81 So.2d 254)

Mime
View raw message