// These should be defined in the calling source... // #local _T1 = text { ttf "/home/pokorny/Fonts/Hack-Regular.ttf" "A" 1.0, 0 } // // #local _T2 = text { ttf "/home/pokorny/Fonts/Hack-Regular.ttf" "AA" 1.0, 0 } // // #local _T3 = text { ttf "/home/pokorny/Fonts/Hack-Regular.ttf" "│" 1.0, 0 } // The 'bar' is full height box character. Fills ascender / descender regions. // Might just using 1.0 be better? Or something in between... #local _T1sz = max_extent(_T1) - min_extent(_T1); #local _T2sz = max_extent(_T2) - min_extent(_T2); #local _T3sz = max_extent(_T3) - min_extent(_T3); #declare _Unit_width = (_T2sz - _T1sz).x; #declare _Unit_height = _T3sz.y; // The _Unit_width = Below very close to ttfdump's for 'LiberationMono-Regular.ttf' // 'hhea' Table - Horizontal Header (advanceWidthMax: 1229) // (There is also a xMaxExtent: 1247) // divided by: // 'head' Table - Font Header (unitsPerEm: 2048) // The _Unit_height = Below very close to ttfdump's // 'head' Table - Font Header (unitsPerEm: 2048) // yMin: -615 // yMax: 1705 // (yMax - yMin) // OR // 'hhea' Table - Horizontal Header // yAscender: 1705 // yDescender: -615 // yLineGap: 0 // (yAscender - yDescender + yLineGap) // divided by: // 'head' Table - Font Header (unitsPerEm: 2048) <-- This used to normalize within POV-Ray // Use ttfdump info to update //#debug concat("_Unit_width = ",str(_Unit_width, 25,17)," (",str(1229/2048, 25,17),")\n") //#debug concat("_Unit_height = ",str(_Unit_height,25,17)," (",str((1705+615)/2048, 25,17),")\n\n") //#error "\nStop"