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

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

    XMLWordPrintableJSON

    Details

    • Type: New Feature
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Flags:
      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. input-fonts.fo
          2 kB
          Juan
        2. font-variant-part-2.patch
          4 kB
          Juan
        3. font-variant.patch
          18 kB
          Juan

          Activity

            People

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

              Dates

              • Created:
                Updated: