The CSS font-variant property is not supported #177

Open
PhenX opened this Issue Dec 6, 2012 · 3 comments

Comments

Projects
None yet
3 participants
Owner

PhenX commented Dec 6, 2012

Original author: fabien.menager (August 04, 2010 21:41:35)

What steps will reproduce the problem?

  1. Use a style with font-variant: small-caps
    2.
    3.

What is the expected output? What do you see instead?
text in "small-caps"
the text is in "normal" font variant

Please use labels and text to provide additional information.
The lowercase chars should be drawn in uppercase with a size like 70% or the original size.

Original issue: http://code.google.com/p/dompdf/issues/detail?id=171

Hi! did you solved this issue? I really need small caps!

Owner

bsweeney commented Feb 22, 2013

We do not currently have a solution for this. You'll have to manually simulate small caps by doing something like: W<span style="text-transform: uppercase; font-size: 70%;">at</span>, or just W<span style="font-size: 70%">at</span>. Unfortunately, you can't just replace the small caps styling with the above because upper-case letters would be similarly affected.

Owner

bsweeney commented Feb 22, 2013

Just a follow-up comment about implementation. Performing a transform and size reduction should work fine. Ideally we'll be able to eventually detect when a font supports this variant and utilize the native support.

Font support appears to come by two methods: as a separate font variant file and as a built-in option (e.g. in OpenType). For fonts that use separate files for each variant updating the font handling to support this should be trivial. For OpenType fonts where variants are all stored in a single file some special handling will be required.

I suggest we add support for the small caps variant by first building in support for additional font variant files combined with text-transform/scaling for fonts without the necessary variant. We can explore supporting the built-in support of OpenType for a future release.

bsweeney referenced this issue in PhenX/php-font-lib Feb 17, 2016

Closed

Performance improvements suggestion #32

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment