General XMetaL Discussion

XMetaL Community Forum General XMetaL Discussion Generate PDF with Symbol, Courier New and Wingding

  • Yuwono

    Generate PDF with Symbol, Courier New and Wingding

    Participants 12
    Replies 13
    Last Activity 11 years, 8 months ago

    Hi,

    I do not understand why XMetal did not generate PDF with specified font-family. However if I use xep.bat directly, the XEP rendered font-family pretty well. If I generated PDF through XMetal, it did not pick up chosen font-family. I don't think there is a problem in RenderX XEP since I am able to render it correctly using XEP.bat. Does anybody experience this before?

    So for example I have these snippet:

    abc –> it generate blank
    –> it showed as “∞”
    Times Font –> it should generate “Times Font” with Times New Roman.

    These are my xep.xml snippet:

       
         
           
           
           
           
         

         
           
         


     

       

    Thank you for your help

    Reply

    gcrews

    Reply to: Generate PDF with Symbol, Courier New and Wingding

    Few thoughts i have:

    batch file is using com.renderx.xep.XSLDriver with j2re1.4.2_08
    xmetal build uses com.xmetal.ws.opentopic.fo.xep.Runner with jre1.5.0

    my guess is that xmetal handles the formatting a little different.
    You might check out some of the files  in the configuration framework:
    http://na.justsystems.com/webhelp/en/xmetalauthor/enterprise/6.0/XMEE.html#Custom%20configuration%20framework
    specifically font-mappings.xml

    Reply

    Yuwono

    Reply to: Generate PDF with Symbol, Courier New and Wingding

    Thank for the answer gcrews.

    Just want to clarify, according to XEP documentation supported fonts, wingding is not supported.

    Has anybody known workaround on this?

    Reply

    Derek Read

    Reply to: Generate PDF with Symbol, Courier New and Wingding

    The documentation for XEP does in fact clearly state that it only supports Unicode encoded fonts (http://mediawiki.renderx.com/index.php/XEP_User_Guide/Appendix_C_Supported_Fonts). I suspect that they are unlikely to alter this but you might wish to check with them anyway.

    A quick test using the Windows charmap.exe tool shows me that it is not a Unicode font. See my screenshot called charmap_test.jpg — if it was a Unicode font then the features highlighted in red would be enabled.

    One workaround might be to try to locate a Unicode font that has the same (or similar glyphs) in it mapped to the characters you want represented that way and use it instead.

    However, I suspect your issue is a little more complex than you understand it to be.

    Wingdings is representing characters in a non-standard way w.r.t. Unicode. The glyphs it uses for characters do not match those suggested in the Unicode specification and are in fact not even close. This is because wingdings is from an earlier time when fonts were limited to containing only 256 characters and Unicode did not exist. So for example, if you use Notepad and set it to use Wingdings as the font and you enter the letter “a” you see the glyph that represents the astrological symbol “[url=http://en.wikipedia.org/wiki/Cancer_%28astrology%29]cancer[/url]”. If you were doing everything in Unicode you would insert the [url=http://unicode.org/charts/PDF/Unicode-6.0/U60-2600.pdf]Unicode character U+264B[/url] (see column 265 row B in that PDF), then use a font that contains a glyph for this character.

    By default, documents created by XMetaL Author Enterprise as well as those generated by the DITA OT to be passed on to XEP to generate PDF files from are encoded in UTF-8 encoding (Unicode). Unicode is generally the way to go, and I would stick with it as much as possible so that you don't end up putting characters into files that aren't actually the characters you want. This will remove your dependency on a particular font (in your case wingdings). You will still need to locate a font that has glyphs for your special characters, but all Unicode fonts are supposed to encode glyphs using the correct character number (called a code point), if they contain a glyph for that character. This means that your problem is reduced simply to locating a Unicode font that defines the character you need. You can use these websites to aid with that:
    http://www.fileformat.info/info/unicode/char/search.htm
    http://www.unicode.org
    or as mentioned above, the charmap.exe tool is also useful as it helps to check on a particular font you already have installed.

    The best solution (in my opinion) is to use a Unicode font that maps characters to glyphs that are “correct” (ie: they have some resemblance to what one would expect them to be as described in the Unicode spec) but this may then require you to change the characters you are using for input to be the “real” characters as defined by Unicode. Depending on which glyphs you want to see out of wingdings.ttf this might require you to use more than one alternative Unicode ttf file.

    This sounds confusing but I'm not sure I can explain it any better. If you have specific characters in mind (perhaps you only use one or two in Wingdings) then knowing what they are might allow me to give an answer that is shorter and easier to understand.

    Reply

    txvia

    Reply to: Generate PDF with Symbol, Courier New and Wingding

    Hi Derek: Could you provide the “easier solution” like you have stated in your previous post? I have a similar problem; I'd like to use just 1 symbol from Wingdings in XMetaL and couldn't find a way to do it, I've read the XEP documentation but to no avail.

    The only symbol I'd like to use is the Mac option key symbol (which is “z”on the qwerty keyboard). In the screenshot you've shown, it seems like you want to replace one of the Arial characters and replace with it with a Wingdings character, is that right? And if that's the case, could you provide a simple tutorial to work around this? Thanks in advance for your help.

    Reply

    Derek Read

    Reply to: Generate PDF with Symbol, Courier New and Wingding

    Wingdings is not a Unicode font and so it would basically go against what I have written in this article and what I feel is the best way to author XML. It is best to use the proper character for a given character and then locate a font containing a glyph for that character and use it. This also assumes your encoding of choice is UTF-8 (which is suggested in the XML Recommendation, and also the default encoding that XMetaL uses unless you specific another supported encoding).

    Entering the “wrong” character into a document (such as “z”) and then using a non-Unicode font that maps that character is just not a good idea, that is the old way of doing things that really just doesn't work well in the XML + Unicode universe. The only time I would not do this is when Unicode has not defined a character that you need. This is possible, but should be exceedingly rare. In that extreme case you might also have good reason to inserting an image instead, though that also has its drawbacks (which is best depends on various other factors).

    First let's clarify which glyph you wish to represent. You say the “option” key. Do you mean the one described on this page: http://en.wikipedia.org/wiki/Option_key

    That is defined in Unicode as U+2325 with the description “OPTION KEY” and (if your browser is capable of rendering it) is this character: ⌥
    The font “Arial Unicode MS” has a glyph for this character so we could simply embed that font to have it appear in your PDF (provided you have that font on your system). Note that Unicode also defines U+2318 with the description “PLACE OF INTEREST SIGN”, which is what Apple uses as their “Command” key. If your browser can render it that character is: ⌘. The font “Arial Unicode MS” has a glyph for this character as well.

    Reply

    txvia

    Reply to: Generate PDF with Symbol, Courier New and Wingding

    Hi Derek: Thanks for the quick reply. Sorry I actually meant the Macintosh “command” key. You mentioned that “Arial Unicode MS” has a glyph for it, how do I embed it or make the character available so that I can just “insert” it while I am editing docs in XmetaL? Could you provide a step-by-step instruction? Thanks again.

    Reply

    Derek Read

    Reply to: Generate PDF with Symbol, Courier New and Wingding

    Option 1:
     Select the character on this page, copy and paste into your document.
     From that point on you could just copy and paste from doc to doc.

    Option 2:
     1. (Windows) Start > Run > charmap.exe
     2. Select a Unicode font that you know contains a glyph for the character. In this case “Arial Unicode MS” happens to have this character.
     3. Click the “Advanced view” checkbox.
     4. Find your character by either:
         a. Entering a number you have obtained from elsewhere (Unicode.org website, forum posting, Wikipedia, etc) into the “Go to Unicode” box.
         b. Search for a portion of the name using the “Search for” box. In this particular case you would need to know that the Apple “command key” is actually not called that in Unicode and is in fact “PLACE OF INTEREST SIGN” (so that none of “apple”, “command” or “key” will find it using this tool as it only searches official Unicode names).
     5. Double click on the character and then select the “Copy” button.
     6. Paste into XMetaL Author.

    Option 3:
     Switch to Plain Text view and type in a character entity reference, such as ⌘

    Option 4:
     In Tags On or Normal view paste in a character entity reference that you have already typed elsewhere. Copying and pasting this should do it: ⌘

    Option 5:
     Configure and use this: http://forums.xmetal.com/index.php/topic,116.0.html

    Option 6:
     1. Create a macro that inserts the character.
     2. Optionally assign that macro to a toolbar or menu.
     Note: this is essentially what option 5 is doing, but in that case a form renders it nicely for you.

    Useful websites:
     http://unicode.org
     http://www.fileformat.info/info/unicode/char/search.htm (searching for “command key” here will in fact find this character as they also include common alternative names and descriptions for characters in their database)
     Once you find the character you can click through to fonts that support it, for example:
     http://www.fileformat.info/info/unicode/char/2318/fontsupport.htm

    Reply

    txvia

    Reply to: Generate PDF with Symbol, Courier New and Wingding

    Hi Derek: Thanks for the detailed explanation, your solution worked like a charm; I got it to work in the WebHelp output. The only problem I am having is that the command key symbol doesn't appear in the PDF output (I used XMetaL Enhanced PDF via RenderX XEP to produce my PDF docs). I read through the links you posted as well as similar discussions previously posted in this forum, I still couldn't get it to work. Basically I tried to insert a few lines of code in both font-mappings.xml and xep.xml to get this to work. Below is what I did (I am running XMetaL 6.0 SP1 on Windows 7 by the way):

    1) In “C:Program Files (x86)Common FilesXMetaL SharedDITA_OTdemoxmfocfgfofont-mappings.xml”, I added the following codes:

    Wingdings

    2) In “C:Program Files (x86)Common FilesXMetaL Sharedrenderxxep.xml”, I added the following:


     

     

    I then redeployed DITA_OT and ran my PDF transform, to no avail.

    Could you tell me what is wrong with code and whether I've done things right so far? Thanks a million.

    Reply

    Derek Read

    Reply to: Generate PDF with Symbol, Courier New and Wingding

    You can't use Wingdings for this (if you have inserted the proper Unicode character as I have suggested). You will need to use another font that contains a glyph for the character U+2318. Wingdings only contains glyphs for ANSI characters, aka Latin1, aka ISO-8859-1 (basically the first 256 characters that overlap with Unicode) and this character is something like the 8984th character (hex 2318) in Unicode.

    I would do two things to troubleshoot this:

    1. Try to embed any Unicode font. One to try first would be Times New Roman as you will have it on your machine. Then check to see that it is actually embedded in the PDF by checking its properties (this will vary depending on the PDF viewing application you have, in Adobe Reader I think all versions have this on the context menu, ie: Shift+F10).

    2. Once you have Times New Roman actually embedded in your PDF then switch it to another font that contains a glyph for U+2318 (check http://www.fileformat.info/info/unicode/char/2318/fontsupport.htm to see if you have any they suggest, if not you will need to obtain one).

    You may need to specify an additional section in your xep.xml file to deal with this particular character or range of characters. The following post is the one you should probably read as it is essentially the same issue: most of your document is in English (or at least one language that is currently readable because it uses characters in the “base 14” fonts that the PDF specification requires all PDF viewing software to support) and so can use the default fonts specified by the DITA OT and RenderX XEP, but a few characters require a specific font to be embedded. It should be fairly straightforward to follow. http://forums.xmetal.com/index.php/topic,116.msg1254.html#msg1254

    Note that the licensing for “Arial Unicode MS” states “editable embedding allowed” (see: http://www.microsoft.com/typography/fonts/font.aspx?FMID=1081) so you can legally embed that font without any issue. If you end up embedding another font in your PDF file you may wish to check its license.

    Reply

    txvia

    Reply to: Generate PDF with Symbol, Courier New and Wingding

    Hi Derek: The embedded font will only appear “embedded” in PDF is when I also defined the default family as “ArialUnicodeMS” (as in the following code in xep.xml):


     
     
     
              xml:base=”fonts/”
            default-family=”ArialUnicodeMS”>

    To actually embed the font, I did the following (also in xep.xml):




                   

    My problem is, I must define “default-family” as “ArialUnicodeMS” in order for the font to be successfully embedded; I already have another type face defined as “default-family” in xep.xml which my organization must use , what should I do so that I can continue using the font I defined previously while embed ArialUnicodeMS? Thanks again for your help!

    Reply

    Derek Read

    Reply to: Generate PDF with Symbol, Courier New and Wingding

    txvia

    Reply to: Generate PDF with Symbol, Courier New and Wingding

    Hi Derek: I've followed the instructions step-by-step detailed in: [url=http://forums.xmetal.com/index.php/topic,116.msg1254.html#msg1254]http://forums.xmetal.com/index.php/topic,116.msg1254.html#msg1254[/url], but that did not work. As I've stated before, the way I got the symbol to appear was when I changed the default-family to ArialUnicodeMS and embed the font in xep.xml. My company must use a proprietary font for its PDF output due to marketing requirements, and we cannot supress that font for something else, this is precisely what my dilemma is.

    If you don't mind, I'd like to send you my version of xep.xml, font-mappings.xml, and en_US.xml in a private message for your reference, maybe by looking at my codes, you'd have a better understanding of where I am coming from. Please reply so I can send these files to you, thanks. 

    Reply

    Derek Read

    Reply to: Generate PDF with Symbol, Courier New and Wingding

    Please submit a support case via the standard support channel. What you are asking can be done (I though it was described in the discussion about the person with Greek character needs — a separate section can be set up to handle certain characters and mapped to a different font).

    I am on vacation for a few days, returning on Friday, so I might get to it then. We have other people here covering support though, so if you log a support case and they can figure it out they might help.

    Reply

  • You must be logged in to reply to this topic.

Lost Your Password?

Products
Downloads
Support