ZF-12418: Zend_Pdf_Font::fontWithPath flags "isEmbeddable" to false even if license allows embedding

Description

Fonts that have multiple embedding bits set, will not be embedded if the 'restricted license embedding' bit is set.

If one the bits 0x0004 or 0x0008 is set, the font is free to be embedded (with some restrictions): Restricted License embedding (0x0002) Preview & Print embedding (0x0004) Editable embedding (0x0008)

If multiple embedding bits are set, the least restrictive license granted takes precedence.

The following code in Zend_Pdf_FileParser_Font_OpenType prevents the correct handling of the flags:

====================== 8< ====================== if ($this->isBitSet(1, $embeddingFlags)) { /* Restricted license embedding. We currently don't have any way to * enforce this, so interpret this as no embed. This may be revised * in the future... / $this->isEmbeddable = false; } else { / The remainder of the bit settings grant us permission to embed * the font. There may be additional usage rights granted or denied * but those only affect the PDF viewer application, not our code. */ $this->isEmbeddable = true; } ====================== 8< ======================

So even if a font has "Editable embedding" set, it will not be embedded by Zend_Pdf if "Restricted license" is also set, although the least restrictive bit should apply.

Comments

Fixed on trunk (25136) and release-1.12 (25137)