Giter VIP home page Giter VIP logo

Comments (12)

SirishaGorasa avatar SirishaGorasa commented on July 22, 2024 1

Sure, Thanks for your quick response.I would check the same and let you know.

from pymupdf.

JorjMcKie avatar JorjMcKie commented on July 22, 2024

This method returns the font name! Using pymupdf.TOOLS.set_subset_fontnames(True) will return the subset prefix too.

from pymupdf.

JorjMcKie avatar JorjMcKie commented on July 22, 2024

BTW please make sure to upgrade your Python version soon.
Version 3.8 will no longer be supported beginning with some release on October.
Seizing support means we will no longer create wheels and stop accepting issues.

from pymupdf.

SirishaGorasa avatar SirishaGorasa commented on July 22, 2024

This worked. Thanks !
Can we get the encoding or the font symbolic name for each span, as there can be different encodings defined for the same base font. Therefore, Font symbolic name helps in this case.

from pymupdf.

JorjMcKie avatar JorjMcKie commented on July 22, 2024

This worked. Thanks ! Can we get the encoding or the font symbolic name for each span, as there can be different encodings defined for the same base font. Therefore, Font symbolic name helps in this case.

No, this is not possible. Between fonts having identical names down to even the subset prefix "ABCDEF+" cannot be differentiated.

from pymupdf.

SirishaGorasa avatar SirishaGorasa commented on July 22, 2024

Can we get the font name from the span as well the base font name too?
For eg.:
For a span, I need to have
"font" : "Calibri" and "BaseFont" : "AFHYFG+Calibri" both.

from pymupdf.

JorjMcKie avatar JorjMcKie commented on July 22, 2024

If a font is a subset or not can be determined by whether there exists a prefix made of 6 uppercase characters followed by a "+".
There is no other information available.

from pymupdf.

SirishaGorasa avatar SirishaGorasa commented on July 22, 2024

Is there a restriction on the number of characters in the subset font name??
For eg.:

The internal structure had the below as the subset font name
/BaseFont /ABCDFG+TimesNewRomanPSMT-BoldCond
and
TOOLS.set_subset_fontnames(True)
and
span["font"]
returned
ABCDFG+TimesNewRomanPSMT-BoldCo

The last two characters from the subset font name are missing.

Can you let me understand why this had happened?

from pymupdf.

JorjMcKie avatar JorjMcKie commented on July 22, 2024

Yes, there is an in-built length restriction of 31 on the font name.

from pymupdf.

SirishaGorasa avatar SirishaGorasa commented on July 22, 2024

Oh, is it??

Which means even though the base font name in the internal structure has the number of characters more than 31, set_subset_fontnames(TRUE), strips it to 31 characters only??

but What if there's a necessity to get the full length base font name???

from pymupdf.

JorjMcKie avatar JorjMcKie commented on July 22, 2024

No way to do this - sorry.

from pymupdf.

SirishaGorasa avatar SirishaGorasa commented on July 22, 2024

That's ok.

Appreciate your quick response.

from pymupdf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.