Embedded font problems

jsmith4332--- via reportlab-users <[email protected]>
Newsgroups gmane.comp.python.reportlab.user
Message-ID <[email protected]>
Hello,
Does anyone have troubleshooting tips for figuring out why an embedded TTF font does not work in reportlab (just shows rectangles)? I'm trying to use https://grandzebu.net/informatique/codbar/code128.ttf (yes, I would like to use a barcode font instead of the built in barcode generator due to quality issues when printing on a low DPI printer)
The relevant code is:
stylesheet = StyleSheet1()

stylesheet.add(
    ParagraphStyle(
        name='Normal',
        fontName='Helvetica',
        fontSize=12,
        leading=16,
        spaceBefore=8,
        spaceAfter=8,
    )
)

stylesheet.add(
    ParagraphStyle(
        name='Barcode',
        fontName='128',
        fontSize=12,
    )
)
pdfmetrics.registerFont(TTFont('128', os.path.join(os.path.realpath(os.path.join(os.getcwd(), os.path.dirname(__file__))), 'code128.ttf')))# story definition omitted...story.append(Paragraph('helloworld'), stylesheet['Barcode']))
Unfortunately, the resulting PDF has a bunch of squares instead of using the barcode font. When I switch to a different ttf, things seem to work. Furthermore, the code128 font referenced above seems to work fine in applications like Microsoft Word/Excel.

Any ideas?
Thanks!
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.