Skip to content

font-variant, small-caps support in pango and fake small-caps #894

Open
@lulu-berlin

Description

@lulu-berlin

My recently merged pull request #891 fixed the issue with correctly parsing the font style. The font-variant was ignored, and caused the font not to be correctly parsed.

I tried to also pass the variant to pango, but it seems that it is being ignored. Most fonts don't support small-caps (which is the only variant besides normal that is available in pango), and it seems to me that pango might not support it when it's there.

Here is my failed attempt to pass the font-variant to pango: lulu-berlin@f002e1a

I played with pangocairo on python with similar results. I couldn't find any font that would show any different when the font variant is set to VARIANT_SMALL_CAPS.

Font rendering on the web uses mostly fake small caps. I think that the general approach is to replace the lowercase characters with uppercase ones and scale them down to 70%. Do we want this also in node-canvas to imitate the browser's behavior? This will not be provided by pango and should be implemented separately.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions