• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

behdad / fonttools / 981
72%

Build:
DEFAULT BRANCH: master
Ran 16 May 2016 12:18PM UTC
Jobs 1
Files 167
Run time 10s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
981

push

travis-ci

anthrotype
cffLib: use tostr() when getting SID of indexed string (or we end up with duplicates in py3)

I noticed this issue while porting compreffor to py3. In my test fonts, the binary
CFF tables as generated with python 2 sometimes were slightly different from the
ones generated with python 3, although the TTX dump was identical!

It turns out, when running in Python 3, cffLib adds extra entries to the
list of CFF indexed strings, because of bytes vs str.

The `IndexedStrings.getSID` method takes an input string 's' and and returns
the SID integer for that string. If it's a new string, it gets appended to the
list, as well as to an internal strings-to-SID mapping, so that the same SID
value is returned for any given string.

The problem with python 3 was that, if the input string was of `bytes` type
instead of `str`, then the test for inclusion (the dict's `__contains__`)
would return False, and as a result the "same" string (e.g. "Regular" and
b"Regular") could be encoded twice in the list of CFF strings.

(yes, we desperately need unit tests for cffLib...)

19423 of 27525 relevant lines covered (70.56%)

0.71 hits per line

Jobs
ID Job ID Ran Files Coverage
13 981.13 (TOXENV=coveralls) 16 May 2016 12:18PM UTC 0
70.56
Travis Job 981.13
Source Files on build 981
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #981
  • 6c1c2a44 on github
  • Prev Build on master (#979)
  • Next Build on master (#983)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc