mirror of https://github.com/JakubMelka/PDF4QT.git
Issue #14: Incorrect text drawing for vertical writing systems
This commit is contained in:
parent
ad12fc89df
commit
e7c102ef48
|
@ -995,6 +995,7 @@ PDFRealizedFontPointer PDFRealizedFont::createRealizedFont(PDFFontPointer font,
|
||||||
impl->m_parentFont = font;
|
impl->m_parentFont = font;
|
||||||
impl->m_pixelSize = pixelSize;
|
impl->m_pixelSize = pixelSize;
|
||||||
|
|
||||||
|
const PDFFontCMap* cmap = font->getCMap();
|
||||||
const FontDescriptor* descriptor = font->getFontDescriptor();
|
const FontDescriptor* descriptor = font->getFontDescriptor();
|
||||||
if (descriptor->isEmbedded())
|
if (descriptor->isEmbedded())
|
||||||
{
|
{
|
||||||
|
@ -1009,7 +1010,7 @@ PDFRealizedFontPointer PDFRealizedFont::createRealizedFont(PDFFontPointer font,
|
||||||
PDFRealizedFontImpl::checkFreeTypeError(FT_New_Memory_Face(impl->m_library, reinterpret_cast<const FT_Byte*>(impl->m_embeddedFontData.constData()), impl->m_embeddedFontData.size(), 0, &impl->m_face));
|
PDFRealizedFontImpl::checkFreeTypeError(FT_New_Memory_Face(impl->m_library, reinterpret_cast<const FT_Byte*>(impl->m_embeddedFontData.constData()), impl->m_embeddedFontData.size(), 0, &impl->m_face));
|
||||||
FT_Select_Charmap(impl->m_face, FT_ENCODING_UNICODE); // We try to select unicode encoding, but if it fails, we don't do anything (use glyph indices instead)
|
FT_Select_Charmap(impl->m_face, FT_ENCODING_UNICODE); // We try to select unicode encoding, but if it fails, we don't do anything (use glyph indices instead)
|
||||||
PDFRealizedFontImpl::checkFreeTypeError(FT_Set_Pixel_Sizes(impl->m_face, 0, qRound(pixelSize * PDFRealizedFontImpl::PIXEL_SIZE_MULTIPLIER)));
|
PDFRealizedFontImpl::checkFreeTypeError(FT_Set_Pixel_Sizes(impl->m_face, 0, qRound(pixelSize * PDFRealizedFontImpl::PIXEL_SIZE_MULTIPLIER)));
|
||||||
impl->m_isVertical = impl->m_face->face_flags & FT_FACE_FLAG_VERTICAL;
|
impl->m_isVertical = cmap ? cmap->isVertical() : false;
|
||||||
impl->m_isEmbedded = true;
|
impl->m_isEmbedded = true;
|
||||||
result.reset(new PDFRealizedFont(implPtr.release()));
|
result.reset(new PDFRealizedFont(implPtr.release()));
|
||||||
}
|
}
|
||||||
|
@ -1035,7 +1036,7 @@ PDFRealizedFontPointer PDFRealizedFont::createRealizedFont(PDFFontPointer font,
|
||||||
PDFRealizedFontImpl::checkFreeTypeError(FT_New_Memory_Face(impl->m_library, reinterpret_cast<const FT_Byte*>(impl->m_systemFontData.constData()), impl->m_systemFontData.size(), 0, &impl->m_face));
|
PDFRealizedFontImpl::checkFreeTypeError(FT_New_Memory_Face(impl->m_library, reinterpret_cast<const FT_Byte*>(impl->m_systemFontData.constData()), impl->m_systemFontData.size(), 0, &impl->m_face));
|
||||||
FT_Select_Charmap(impl->m_face, FT_ENCODING_UNICODE); // We try to select unicode encoding, but if it fails, we don't do anything (use glyph indices instead)
|
FT_Select_Charmap(impl->m_face, FT_ENCODING_UNICODE); // We try to select unicode encoding, but if it fails, we don't do anything (use glyph indices instead)
|
||||||
PDFRealizedFontImpl::checkFreeTypeError(FT_Set_Pixel_Sizes(impl->m_face, 0, qRound(pixelSize * PDFRealizedFontImpl::PIXEL_SIZE_MULTIPLIER)));
|
PDFRealizedFontImpl::checkFreeTypeError(FT_Set_Pixel_Sizes(impl->m_face, 0, qRound(pixelSize * PDFRealizedFontImpl::PIXEL_SIZE_MULTIPLIER)));
|
||||||
impl->m_isVertical = impl->m_face->face_flags & FT_FACE_FLAG_VERTICAL;
|
impl->m_isVertical = cmap ? cmap->isVertical() : false;
|
||||||
impl->m_isEmbedded = false;
|
impl->m_isEmbedded = false;
|
||||||
if (const char* postScriptName = FT_Get_Postscript_Name(impl->m_face))
|
if (const char* postScriptName = FT_Get_Postscript_Name(impl->m_face))
|
||||||
{
|
{
|
||||||
|
|
|
@ -276,6 +276,9 @@ public:
|
||||||
/// Returns ToUnicode mapping (or nullptr, if font has no mapping to unicode)
|
/// Returns ToUnicode mapping (or nullptr, if font has no mapping to unicode)
|
||||||
virtual const PDFFontCMap* getToUnicode() const { return nullptr; }
|
virtual const PDFFontCMap* getToUnicode() const { return nullptr; }
|
||||||
|
|
||||||
|
/// Returns cmap for font character encoding
|
||||||
|
virtual const PDFFontCMap* getCMap() const { return nullptr; }
|
||||||
|
|
||||||
/// Returns font descriptor
|
/// Returns font descriptor
|
||||||
const FontDescriptor* getFontDescriptor() const { return &m_fontDescriptor; }
|
const FontDescriptor* getFontDescriptor() const { return &m_fontDescriptor; }
|
||||||
|
|
||||||
|
@ -488,6 +491,9 @@ public:
|
||||||
/// Returns true, if mapping is valid
|
/// Returns true, if mapping is valid
|
||||||
bool isValid() const { return !m_entries.empty(); }
|
bool isValid() const { return !m_entries.empty(); }
|
||||||
|
|
||||||
|
/// Returns true, if vertical writing mode is on
|
||||||
|
bool isVertical() const { return m_vertical; }
|
||||||
|
|
||||||
/// Creates mapping from name (name must be one of predefined names)
|
/// Creates mapping from name (name must be one of predefined names)
|
||||||
static PDFFontCMap createFromName(const QByteArray& name);
|
static PDFFontCMap createFromName(const QByteArray& name);
|
||||||
|
|
||||||
|
@ -612,7 +618,7 @@ public:
|
||||||
virtual FontType getFontType() const override { return FontType::Type0; }
|
virtual FontType getFontType() const override { return FontType::Type0; }
|
||||||
virtual const PDFFontCMap* getToUnicode() const override { return &m_toUnicode; }
|
virtual const PDFFontCMap* getToUnicode() const override { return &m_toUnicode; }
|
||||||
|
|
||||||
const PDFFontCMap* getCMap() const { return &m_cmap; }
|
virtual const PDFFontCMap* getCMap() const override { return &m_cmap; }
|
||||||
const PDFCIDtoGIDMapper* getCIDtoGIDMapper() const { return &m_mapper; }
|
const PDFCIDtoGIDMapper* getCIDtoGIDMapper() const { return &m_mapper; }
|
||||||
|
|
||||||
/// Returns the glyph advance, if it can be obtained, or zero, if it cannot
|
/// Returns the glyph advance, if it can be obtained, or zero, if it cannot
|
||||||
|
|
|
@ -51,9 +51,9 @@ Software have following features (the list is not complete):
|
||||||
- [x] internal structure inspector
|
- [x] internal structure inspector
|
||||||
- [x] compare documents
|
- [x] compare documents
|
||||||
- [x] static XFA support (readonly, simple XFA only)
|
- [x] static XFA support (readonly, simple XFA only)
|
||||||
- [ ] create fillable forms *(planned in year 2022)*
|
- [x] electronically/digitally sign documents
|
||||||
- [ ] electronically/digitally sign documents *(planned in year 2022)*
|
- [ ] 3D PDF support *(planned in year 2022)*
|
||||||
- [ ] 3D PDF support *(planned in year 2023)*
|
- [ ] create fillable forms *(planned in year 2023)*
|
||||||
- [ ] watermarks / headers / footers *(planned in year 2023)*
|
- [ ] watermarks / headers / footers *(planned in year 2023)*
|
||||||
- [ ] presentation application *(planned in year 2023)*
|
- [ ] presentation application *(planned in year 2023)*
|
||||||
- [ ] public key security encryption *(planned in year 2023)*
|
- [ ] public key security encryption *(planned in year 2023)*
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
CURRENT:
|
CURRENT:
|
||||||
|
|
||||||
- Issue #10: Performance optimization
|
- Issue #10: Performance optimization
|
||||||
|
- Issue #14: Incorrect text drawing for vertical writing systems
|
||||||
- static XFA support (readonly, simple XFA only)
|
- static XFA support (readonly, simple XFA only)
|
||||||
|
- electronically/digitally sign documents
|
||||||
|
|
||||||
V: 1.1.0, 19.12.2021
|
V: 1.1.0, 19.12.2021
|
||||||
- DocDiff application (compare similar PDF documents)
|
- DocDiff application (compare similar PDF documents)
|
||||||
|
|
Loading…
Reference in New Issue