How to retrieve contents of a NameRecord in Fonttools?

Jason Campbell
Posts: 100
This will get me the list of name table entries:
ttfont = TTFont(filename)
print str(ttfont['name'].names)
But what if I want to retrieve the associated record, like retrieve the copyright as a string?
I was hoping this would work:
But what if I want to retrieve the associated record, like retrieve the copyright as a string?
I was hoping this would work:
ttfont = TTFont(filename)
print str(ttfont['name'].getName(0,1,0))
but that just returns:
but that just returns:
<NameRecord NameID=0; PlatformID=1; LanguageID=0>
thanks!
0
Comments
-
print ttfont['name'].getName(0,1,0).string
0 -
thanks, I knew I must be missing something simple!0
Categories
- All Categories
- 46 Introductions
- 3.9K Typeface Design
- 485 Type Design Critiques
- 560 Type Design Software
- 1.1K Type Design Technique & Theory
- 653 Type Business
- 848 Font Technology
- 29 Punchcutting
- 519 Typography
- 119 Type Education
- 323 Type History
- 77 Type Resources
- 111 Lettering and Calligraphy
- 32 Lettering Critiques
- 79 Lettering Technique & Theory
- 548 Announcements
- 90 Events
- 114 Job Postings
- 170 Type Releases
- 173 Miscellaneous News
- 276 About TypeDrawers
- 54 TypeDrawers Announcements
- 120 Suggestions and Bug Reports