question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Constructing a STAT table

See original GitHub issue

Are there any examples for building a complete STAT table? I’m trying to compile one from a manually written TTX source, but I can’t seem to get the attribute names right.

  <STAT>
    <Version value="0x00010001"/>
    <DesignAxisRecordSize value="3"/>
    <!-- DesignAxisCount=4 -->
    <DesignAxisRecord>
      <Axis index="0">
        <AxisTag value="wght"/>
        <AxisNameID value="256"/>
        <AxisOrdering value="0"/>
      </Axis>
      <Axis index="1">
        <AxisTag value="wdth"/>
        <AxisNameID value="257"/>
        <AxisOrdering value="1"/>
      </Axis>
      <Axis index="1">
        <AxisTag value="opsz"/>
        <AxisNameID value="258"/>
        <AxisOrdering value="1"/>
      </Axis>
      <Axis index="2">
        <AxisTag value="ital"/>
        <AxisNameID value="259"/>
        <AxisOrdering value="2"/>
      </Axis>
    </DesignAxisRecord>
    <!-- AxisValueCount=1 -->
    <AxisValueArray>
      <!-- Regular -->
      <AxisValue>
        <Format value="3"/>
        <AxisIndex value="0"/>
        <Flags value="ElidableAxisValueName"/>
        <ValueNameID value="260"/>
        <Value value="400"/>
        <LinkedValue value="700"/>
      </AxisValue>
      <!-- Bold -->
      <AxisValue>
        <Format value="1"/>
        <AxisIndex value="0"/>
        <Flags/>
        <ValueNameID value="264"/>
        <Value value="700"/>
      </AxisValue>
      <!-- Italic -->
      <AxisValue>
        <Format value="3"/>
        <AxisIndex value="2"/>
        <Flags value="ElidableAxisValueName"/>
        <ValueNameID value="260"/>
        <Value value="0"/>
        <LinkedValue value="1"/>
      </AxisValue>
    </AxisValueArray>
    <ElidedFallbackNameID value="260"/>
  </STAT>

I get a traceback:

Parsing 'STAT' table...
ERROR: Unhandled exception has occurred
Traceback (most recent call last):
  File "/Users/jens/Library/Python/2.7/lib/python/site-packages/fontTools/ttx.py", line 387, in main
    process(jobs, options)
  File "/Users/jens/Library/Python/2.7/lib/python/site-packages/fontTools/ttx.py", line 361, in process
    action(input, output, options)
  File "/Users/jens/Library/Python/2.7/lib/python/site-packages/fontTools/misc/loggingTools.py", line 372, in wrapper
    return func(*args, **kwds)
  File "/Users/jens/Library/Python/2.7/lib/python/site-packages/fontTools/ttx.py", line 272, in ttCompile
    ttf.importXML(input)
  File "/Users/jens/Library/Python/2.7/lib/python/site-packages/fontTools/ttLib/__init__.py", line 372, in importXML
    reader.read()
  File "/Users/jens/Library/Python/2.7/lib/python/site-packages/fontTools/misc/xmlReader.py", line 48, in read
    self._parseFile(self.file)
  File "/Users/jens/Library/Python/2.7/lib/python/site-packages/fontTools/misc/xmlReader.py", line 73, in _parseFile
    parser.Parse(chunk, 0)
  File "/Users/jens/Library/Python/2.7/lib/python/site-packages/fontTools/misc/xmlReader.py", line 141, in _endElementHandler
    self.currentTable.fromXML(name, attrs, content, self.ttFont)
  File "/Users/jens/Library/Python/2.7/lib/python/site-packages/fontTools/ttLib/tables/otBase.py", line 100, in fromXML
    self.table.fromXML(name, attrs, content, font)
  File "/Users/jens/Library/Python/2.7/lib/python/site-packages/fontTools/ttLib/tables/otBase.py", line 738, in fromXML
    value = conv.xmlRead(attrs, content, font)
  File "/Users/jens/Library/Python/2.7/lib/python/site-packages/fontTools/ttLib/tables/otConverters.py", line 391, in xmlRead
    table.fromXML(name, attrs, content, font)
  File "/Users/jens/Library/Python/2.7/lib/python/site-packages/fontTools/ttLib/tables/otBase.py", line 738, in fromXML
    value = conv.xmlRead(attrs, content, font)
  File "/Users/jens/Library/Python/2.7/lib/python/site-packages/fontTools/ttLib/tables/otConverters.py", line 378, in xmlRead
    for conv in table.getConverters():
  File "/Users/jens/Library/Python/2.7/lib/python/site-packages/fontTools/ttLib/tables/otBase.py", line 772, in getConverters
    return self.converters[self.Format]
  File "/Users/jens/Library/Python/2.7/lib/python/site-packages/fontTools/ttLib/tables/otBase.py", line 539, in __getattr__
    raise AttributeError(attr)
AttributeError: Format

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:12 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
punchcuttercommented, Jul 17, 2020

I hope nobody did anything yet because I’m basically done with this. Just need to clean up a bit and add more tests, but so far I got it working the same as makeotf.

0reactions
jenskutilekcommented, Aug 10, 2022

I think this is done now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Construction of a Statistical Table | eMathZone
A table should be simple and attractive. · Proper and clear headings for columns and rows are necessary. · Suitable approximation may be...
Read more >
How To Make a Simple Frequency Table - YouTube
begin by making a two-column table · begin by making a two-column table · begin by making a two-column table · add up...
Read more >
Creating frequency tables - StatCrunch
This tutorial covers the steps for creating frequency tables in StatCrunch. To begin, load the Two Categorical Variablesopens in new window data set,...
Read more >
Frequency Distribution Table: Examples, How to Make One
A frequency distribution table is one way you can organize data so that it makes more sense. For example, let's say you have...
Read more >
TABLES AND FORMULAS FOR MOORE Basic Practice of ...
Plus four to greatly improve accuracy: use the same formula after adding 2 successes and two failures to the data. • z test...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found