Uploaded image for project: 'FOP'
  1. FOP
  2. FOP-2878

[PATCH] Font-variant (small-caps) partial implementation

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • None
    • None
    • Patch

    Description

      https://www.w3.org/TR/xsl/#font-variant

      Implemented small-caps support, working cases:

      • Fake small-caps: When using a normal font, the lowercase letters are changed to uppercase but keeping the small size.
        • Since it's always possible to scale characters, there's no need to implement the last fallback: "As a last resort, unscaled uppercase letter glyphs in a normal font may replace glyphs in a small-caps font so that the text appears in all uppercase letters"
      • Autodetected small-caps fonts: Improved auto-detection (font name based) to also detect smallcaps.
      • Manually added true small-caps fonts: A true small-caps font can be enabled on config file, that version of the font will be used instead of applying the fake transformation.

       

      Font config example:

      <font embed-url="arial-smallcaps.ttf">
       <font-triplet name="Arial" style="smallcaps" weight="normal"/>
      </font>

       

      See input-fonts.fo for sample input.

      Note: font-variant-part-2.patch is based on font-variant.patch, so they should be applied in order.

      font-variant.patch: Adds fake small-caps and manually added small-caps fonts.

      font-variant-part-2.patch: Adds small-caps font autodetection.

      Attachments

        1. font-variant.patch
          18 kB
          Juan
        2. font-variant-part-2.patch
          4 kB
          Juan
        3. font-variant-part-3.patch
          2 kB
          Juan
        4. input-fonts.fo
          2 kB
          Juan
        5. output-fonts.pdf
          6 kB
          J Frank
        6. output-fonts-before fix.pdf
          5 kB
          J Frank
        7. patch-FOP-2878.diff
          16 kB
          J Frank

        Activity

          People

            Unassigned Unassigned
            juani15151 Juan
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: