Skip to main content
Known Participant
August 4, 2009
Answered

Round tripping the Symbol Font

  • August 4, 2009
  • 1 reply
  • 1833 views

Hi all,

We need to round-trip basic Greek symbols in inline text, such as a beta, represented by a lower case "b" in Symbol. This sounds pretty basic, but I can't get it to work and have read everything I can find about it. I am using Fm 9 and saving to xml.

It seems that Frame should inherently contain the rules to map this to an entity in XML, using either a code point 0x62, or its Unicode equivalent (U+03B2U ?), and that I should not need to create an entity in the DTD that represents it, nor explicitly add it to the rules.

On save to XML, however, the character is not represented properly, displaying just a "?", and of course, does not come back into Frame either. I can use the File | Utilities | Hex Input tool to enter the hex equivalent (which does save to XML as the entity "/b")  -- but of course, the Frame document then displays that hex equivalent, rather than the actual Symbol font  -- which won't work for PDFs, of course, and is also hard for the writer to work with.

I have read of several ways of mapping special characters like these -- one to create an element something like SymbolFont for which the EDD applies the correct font, others to add specific rules to the rules document.

Any help is very much appreciated.

-- Shelley Hoose

Rogue Wave Software

This topic has been closed for replies.
Correct answer Lynne A. Price

Shelley,
  XML predefines 5 entities for special characters that are used in markup: amp, lt, gt, apos, quot. All other referenced entities must be declared in the DTD, either in the external subset identified by an external identifier in the document type declaration or in the internal subset the declaration contains:

   <!DOCTYPE root externalId [
      declarations in internal subset
   ]>

  This requirement makes sense. Any entities that are not defined in the XML recommendation itself have to be defined somewhere. There are, however, many commonly used characters that often appear in XML documents. The SGML standard defines 19 sets of such special characters. These ISO public entity sets are fairly pervasive in both SGML and XML documents. One of them is ISOgrk1, used for Greek letters. Publicly available DTDs such as DocBook often include all 19 ISO public entity sets. Thus, while entities must be declared in the DTD, there are commonly accepted methods of doing so.

  Defining an entity is not sufficient to specify how references to that entity should be formatted in FrameMaker. For example, some users may want Greek letters to be displayed in the symbol font, some users may use a Greek font in which the Greek letters appear in the same position as the corresponding Roman letters in fonts of Roman letters, and some users may want to use the Unicode character numbers in an alphabetic font.

  FrameMaker provides read/write rules which allow the user to associate a character with an entity. It also provides a file of read/write rules for each of the 19 ISO public entity sets. These default read/write rules are in $STRUCTDIR\xml\isoents and they can be included within read/write rules with directives such as:

#include "isolat1.rw"
#include "isogrk1.rw"
#include "isotech.rw"

There is no need to specify the full path of these read/write rules because isoents is in the default rules search path.

  The isoents folder also includes a file called isoall.rw which contains the include directives for each of the 19 character sets. All the default rules can therefore be included in your own rules file with the single directive:

#include "isoall.rw"

  Users can of course use rules other than the default.

  For example, the ISOgrk1 entity for a lowercase alpha is agr. FrameMaker's default rule for agr is:

    entity "agr" is fm char 0x61 in "FmSymbol";

This rule maps the entity to character hex 61 in character format FmSymbol. For this rule to be used:

1. The entity must be declared in the DTD

2. Format FmSymbol must be defined in the character catalog to use a non-alphabetic font, defined in maker.ini with a statement such as:

    NonTextFamilies=ZapfDingbats, Symbol, WingDings, Monotype Sorts, Euro Monospace, Euro Sans, Euro Serif

3. Character format FmSymbol must be applied to the alphas in the document

        --Lynne

1 reply

Lynne A. PriceCorrect answer
Inspiring
September 18, 2009

Shelley,
  XML predefines 5 entities for special characters that are used in markup: amp, lt, gt, apos, quot. All other referenced entities must be declared in the DTD, either in the external subset identified by an external identifier in the document type declaration or in the internal subset the declaration contains:

   <!DOCTYPE root externalId [
      declarations in internal subset
   ]>

  This requirement makes sense. Any entities that are not defined in the XML recommendation itself have to be defined somewhere. There are, however, many commonly used characters that often appear in XML documents. The SGML standard defines 19 sets of such special characters. These ISO public entity sets are fairly pervasive in both SGML and XML documents. One of them is ISOgrk1, used for Greek letters. Publicly available DTDs such as DocBook often include all 19 ISO public entity sets. Thus, while entities must be declared in the DTD, there are commonly accepted methods of doing so.

  Defining an entity is not sufficient to specify how references to that entity should be formatted in FrameMaker. For example, some users may want Greek letters to be displayed in the symbol font, some users may use a Greek font in which the Greek letters appear in the same position as the corresponding Roman letters in fonts of Roman letters, and some users may want to use the Unicode character numbers in an alphabetic font.

  FrameMaker provides read/write rules which allow the user to associate a character with an entity. It also provides a file of read/write rules for each of the 19 ISO public entity sets. These default read/write rules are in $STRUCTDIR\xml\isoents and they can be included within read/write rules with directives such as:

#include "isolat1.rw"
#include "isogrk1.rw"
#include "isotech.rw"

There is no need to specify the full path of these read/write rules because isoents is in the default rules search path.

  The isoents folder also includes a file called isoall.rw which contains the include directives for each of the 19 character sets. All the default rules can therefore be included in your own rules file with the single directive:

#include "isoall.rw"

  Users can of course use rules other than the default.

  For example, the ISOgrk1 entity for a lowercase alpha is agr. FrameMaker's default rule for agr is:

    entity "agr" is fm char 0x61 in "FmSymbol";

This rule maps the entity to character hex 61 in character format FmSymbol. For this rule to be used:

1. The entity must be declared in the DTD

2. Format FmSymbol must be defined in the character catalog to use a non-alphabetic font, defined in maker.ini with a statement such as:

    NonTextFamilies=ZapfDingbats, Symbol, WingDings, Monotype Sorts, Euro Monospace, Euro Sans, Euro Serif

3. Character format FmSymbol must be applied to the alphas in the document

        --Lynne

shooseAuthor
Known Participant
September 21, 2009

Hi Lynne,

This was hugely helpful, as it brought it all together for me. I had all the pieces in place except that I did not know of or understand the mapping in the .rw files, so I had a char format called just "Symbol." Then I was trying to map it in our rules document, but it wasn't working, perhaps because I had it lower down in the file after the #include "isoall.rw" statement, which meant that Frame wasn't using it at all but using the default rules.

So the way it worked for me was to:

  • Declare no special entities or rules, but just let Frame govern the conversion to and from xml through the entity definitions and rules at <framedir>/Structure\xml\isoents.
  • Create a custom inline element Symbol, defined in the DTD
  • Create a char style FmSymbol with everything "as is" and the Family set to the Symbol font
  • In the EDD formatting rules, assign the Symbol element in all contexts to use this char style

Our Symbol element can contain an Emphasis element also, to support subscript and superscript formatting.

Thanks very much!

-- Shelley