KiCad PCB EDA Suite
Loading...
Searching...
No Matches
pdf_outline_font.cpp
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 3
9 * of the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <https://www.gnu.org/licenses/>.
18 */
19
22#include <trace_helpers.h>
23#include <wx/log.h>
24#include <cstdlib>
25
26#include <algorithm>
27#include <cctype>
28#include <limits>
29#include <cmath>
30
31#include <fmt/format.h>
32#include <harfbuzz/hb-ft.h>
33#include <harfbuzz/hb.h>
34#include <wx/ffile.h>
35
36#include <core/utf8.h>
37
38#include <ft2build.h>
39#include FT_FREETYPE_H
40
41#include <font/font.h>
42
43namespace
44{
45std::u32string utf8ToU32( const std::string& aUtf8 )
46{
47 std::u32string result;
48 UTF8 utf8( aUtf8.c_str() );
49
50 for( auto it = utf8.ubegin(); it < utf8.uend(); ++it )
51 result.push_back( static_cast<uint32_t>( *it ) );
52
53 return result;
54}
55
56std::string generateSubsetPrefix( unsigned aSubsetIndex )
57{
58 static constexpr char letters[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
59 std::string prefix( 6, 'A' );
60
61 for( int ii = 5; ii >= 0; --ii )
62 {
63 prefix[ii] = letters[ aSubsetIndex % 26 ];
64 aSubsetIndex /= 26;
65 }
66
67 return prefix;
68}
69
70double unitsToPdf( double aValue, double aUnitsPerEm )
71{
72 if( aUnitsPerEm == 0.0 )
73 return 0.0;
74
75 return aValue * 1000.0 / aUnitsPerEm;
76}
77}
78
80{
81 if( m_glyphIndex != aOther.m_glyphIndex )
82 return m_glyphIndex < aOther.m_glyphIndex;
83
84 return m_unicode < aOther.m_unicode;
85}
86
88 m_font( aFont ),
89 m_resourceName( makeResourceName( aSubsetIndex ) ),
90 m_baseFontName( makeSubsetName( aFont, aSubsetIndex ) ),
91 m_unitsPerEm( 1000.0 ),
92 m_ascent( 0.0 ),
93 m_descent( 0.0 ),
94 m_capHeight( 0.0 ),
95 m_italicAngle( 0.0 ),
96 m_stemV( 80.0 ),
97 m_bboxMinX( 0.0 ),
98 m_bboxMinY( 0.0 ),
99 m_bboxMaxX( 0.0 ),
100 m_bboxMaxY( 0.0 ),
101 m_flags( 32 ),
102 m_fontDataLoaded( false ),
103 m_nextCID( 1 ),
104 m_fontFileHandle( -1 ),
106 m_cidFontHandle( -1 ),
107 m_cidMapHandle( -1 ),
108 m_toUnicodeHandle( -1 ),
109 m_fontHandle( -1 )
110{
111 FT_Face face = aFont ? aFont->GetFace() : nullptr;
112
113 if( face )
114 {
115 if( face->units_per_EM > 0 )
116 m_unitsPerEm = static_cast<double>( face->units_per_EM );
117
118 m_ascent = unitsToPdf( static_cast<double>( face->ascender ), m_unitsPerEm );
119 m_descent = unitsToPdf( static_cast<double>( face->descender ), m_unitsPerEm );
120 m_capHeight = unitsToPdf( static_cast<double>( face->bbox.yMax ), m_unitsPerEm );
121 m_bboxMinX = unitsToPdf( static_cast<double>( face->bbox.xMin ), m_unitsPerEm );
122 m_bboxMinY = unitsToPdf( static_cast<double>( face->bbox.yMin ), m_unitsPerEm );
123 m_bboxMaxX = unitsToPdf( static_cast<double>( face->bbox.xMax ), m_unitsPerEm );
124 m_bboxMaxY = unitsToPdf( static_cast<double>( face->bbox.yMax ), m_unitsPerEm );
125
126 if( face->style_flags & FT_STYLE_FLAG_ITALIC )
127 m_italicAngle = -12.0;
128 else if( aFont->IsItalic() )
129 m_italicAngle = -12.0;
130
131 if( aFont->IsBold() )
132 m_stemV = 140.0;
133
134 if( face->face_flags & FT_FACE_FLAG_FIXED_WIDTH )
135 m_flags |= 1;
136
137 if( aFont->IsItalic() )
138 m_flags |= 64;
139 }
140
141 m_widths.resize( 1, 0.0 );
142 m_cidToGid.resize( 1, 0 );
143 m_cidToUnicode.resize( 1 );
144}
145
147{
148 return m_nextCID > 1;
149}
150
152{
153 if( m_widths.empty() )
154 {
155 m_widths.resize( 1, 0.0 );
156 m_cidToGid.resize( 1, 0 );
157 m_cidToUnicode.resize( 1 );
158 }
159}
160
161uint16_t PDF_OUTLINE_FONT_SUBSET::EnsureGlyph( uint32_t aGlyphIndex, const std::u32string& aUnicode )
162{
163 if( aGlyphIndex == 0 )
164 return 0;
165
166 GLYPH_KEY key{ aGlyphIndex, aUnicode };
167
168 auto it = m_glyphMap.find( key );
169
170 if( it != m_glyphMap.end() )
171 return it->second;
172
173 ensureNotdef();
174
175 FT_Face face = m_font ? m_font->GetFace() : nullptr;
176
177 if( !face )
178 return 0;
179
180 if( FT_Load_Glyph( face, aGlyphIndex, FT_LOAD_NO_SCALE | FT_LOAD_NO_HINTING ) )
181 return 0;
182
183 // For FT_LOAD_NO_SCALE the advance.x should be in font units (26.6) unless metrics differ.
184 // We divide by 64.0 to get raw font units; convert to our internal PDF user units via unitsToPdf.
185 double rawAdvance266 = static_cast<double>( face->glyph->advance.x );
186 double rawAdvanceFontUnits = rawAdvance266 / 64.0;
187 double advance = unitsToPdf( rawAdvanceFontUnits, m_unitsPerEm );
188
189 uint16_t cid = m_nextCID++;
190
191 if( m_widths.size() <= cid )
192 m_widths.resize( cid + 1, 0.0 );
193
194 if( m_cidToGid.size() <= cid )
195 m_cidToGid.resize( cid + 1, 0 );
196
197 if( m_cidToUnicode.size() <= cid )
198 m_cidToUnicode.resize( cid + 1 );
199
200 m_widths[cid] = advance;
201
202 if( std::getenv( "KICAD_DEBUG_FONT_ADV" ) )
203 {
204 wxLogTrace( tracePdfPlotter,
205 "EnsureGlyph font='%s' gid=%u cid=%u rawAdvance26.6=%f rawAdvanceUnits=%f storedAdvancePdfUnits=%f unitsPerEm=%f", \
206 m_font ? m_font->GetName().ToUTF8().data() : "(null)", (unsigned) aGlyphIndex, (unsigned) cid, \
207 rawAdvance266, rawAdvanceFontUnits, advance, m_unitsPerEm );
208 }
209 m_cidToGid[cid] = static_cast<uint16_t>( aGlyphIndex );
210 m_cidToUnicode[cid] = aUnicode;
211
212 m_glyphMap.emplace( key, cid );
213
214 return cid;
215}
216
217const std::vector<uint8_t>& PDF_OUTLINE_FONT_SUBSET::FontFileData()
218{
219 if( !m_fontDataLoaded )
220 {
221 m_fontDataLoaded = true;
222
223 if( !m_font )
224 return m_fontData;
225
226 wxString fontFile = m_font->GetFileName();
227
228 if( fontFile.IsEmpty() )
229 return m_fontData;
230
231 wxFFile file( fontFile, wxT( "rb" ) );
232
233 if( !file.IsOpened() )
234 return m_fontData;
235
236 wxFileOffset length = file.Length();
237
238 if( length > 0 )
239 {
240 m_fontData.resize( static_cast<size_t>( length ) );
241 file.Read( m_fontData.data(), length );
242 }
243 }
244
245 return m_fontData;
246}
247
249{
250 // Return empty if there are no glyphs beyond .notdef
251 if( m_nextCID <= 1 )
252 return std::string( "[]" );
253
254 // PDF expects widths in 1000/em units for CIDFontType2 /W array entries.
255 // m_widths currently stores advance in PDF user units produced by unitsToPdf().
256 // This is a bit of a fudge factor to reconstruct the output width
257 double designScale = 0.0072 * 2.25;
258 int logCount = 0;
259
260 fmt::memory_buffer buffer;
261 fmt::format_to( std::back_inserter( buffer ), "[ 1 [" );
262
263 for( uint16_t cid = 1; cid < m_nextCID; ++cid )
264 {
265 double adv = m_widths[cid];
266 long width1000 = 0;
267
268 if( designScale != 0.0 )
269 width1000 = lrint( adv / designScale );
270
271 fmt::format_to( std::back_inserter( buffer ), " {}", width1000 );
272
273 if( std::getenv( "KICAD_DEBUG_FONT_ADV" ) && logCount < 16 )
274 {
275 wxLogTrace( tracePdfPlotter, "BuildWidthsArray FIXED cid=%u advPdfUnits=%f width1000=%ld", (unsigned) cid, adv, width1000 );
276 ++logCount;
277 }
278 }
279
280 fmt::format_to( std::back_inserter( buffer ), " ] ]" );
281 return std::string( buffer.data(), buffer.size() );
282}
283
285{
286 if( m_nextCID <= 1 )
287 return std::string();
288
289 fmt::memory_buffer buffer;
290
291 std::string cmapName = m_baseFontName + "_ToUnicode";
292
293 fmt::format_to( std::back_inserter( buffer ), "/CIDInit /ProcSet findresource begin\n" );
294 fmt::format_to( std::back_inserter( buffer ), "12 dict begin\n" );
295 fmt::format_to( std::back_inserter( buffer ), "begincmap\n" );
296 fmt::format_to( std::back_inserter( buffer ), "/CIDSystemInfo << /Registry (Adobe) /Ordering (Identity) /Supplement 0 >> def\n" );
297 fmt::format_to( std::back_inserter( buffer ), "/CMapName /{} def\n", cmapName );
298 fmt::format_to( std::back_inserter( buffer ), "/CMapType 2 def\n" );
299 fmt::format_to( std::back_inserter( buffer ), "1 begincodespacerange\n" );
300 fmt::format_to( std::back_inserter( buffer ), "<0000> <FFFF>\n" );
301 fmt::format_to( std::back_inserter( buffer ), "endcodespacerange\n" );
302
303 size_t mappingCount = 0;
304
305 for( uint16_t cid = 1; cid < m_nextCID; ++cid )
306 {
307 if( !m_cidToUnicode[cid].empty() )
308 ++mappingCount;
309 }
310
311 fmt::format_to( std::back_inserter( buffer ), "{} beginbfchar\n", mappingCount );
312
313 for( uint16_t cid = 1; cid < m_nextCID; ++cid )
314 {
315 const std::u32string& unicode = m_cidToUnicode[cid];
316
317 if( unicode.empty() )
318 continue;
319
320 fmt::format_to( std::back_inserter( buffer ), "<{:04X}> <", cid );
321
322 for( uint32_t codepoint : unicode )
323 fmt::format_to( std::back_inserter( buffer ), "{}", FormatPdfUtf16Hex( codepoint ) );
324
325 fmt::format_to( std::back_inserter( buffer ), ">\n" );
326 }
327
328 fmt::format_to( std::back_inserter( buffer ), "endbfchar\n" );
329 fmt::format_to( std::back_inserter( buffer ), "endcmap\n" );
330 fmt::format_to( std::back_inserter( buffer ), "CMapName currentdict /CMap defineresource pop\n" );
331 fmt::format_to( std::back_inserter( buffer ), "end\n" );
332 fmt::format_to( std::back_inserter( buffer ), "end\n" );
333
334 return std::string( buffer.data(), buffer.size() );
335}
336
338{
339 std::string data;
340
341 if( m_nextCID == 0 )
342 return data;
343
344 data.resize( static_cast<size_t>( m_nextCID ) * 2, 0 );
345
346 for( uint16_t cid = 0; cid < m_nextCID; ++cid )
347 {
348 uint16_t gid = cid < m_cidToGid.size() ? m_cidToGid[cid] : 0;
349 data[ cid * 2 ] = static_cast<char>( ( gid >> 8 ) & 0xFF );
350 data[ cid * 2 + 1 ] = static_cast<char>( gid & 0xFF );
351 }
352
353 return data;
354}
355
356std::string PDF_OUTLINE_FONT_SUBSET::makeResourceName( unsigned aSubsetIndex )
357{
358 return fmt::format( "/KiCadOutline{}", aSubsetIndex );
359}
360
361std::string PDF_OUTLINE_FONT_SUBSET::sanitizeFontName( const wxString& aName )
362{
363 std::string utf8 = UTF8( aName ).substr();
364 std::string sanitized;
365 sanitized.reserve( utf8.size() );
366
367 for( unsigned char ch : utf8 )
368 {
369 if( std::isalnum( ch ) )
370 sanitized.push_back( static_cast<char>( ch ) );
371 else
372 sanitized.push_back( '-' );
373 }
374
375 if( sanitized.empty() )
376 sanitized = "Font";
377
378 return sanitized;
379}
380
381std::string PDF_OUTLINE_FONT_SUBSET::makeSubsetName( KIFONT::OUTLINE_FONT* aFont, unsigned aSubsetIndex )
382{
383 std::string prefix = generateSubsetPrefix( aSubsetIndex );
384 std::string name = aFont ? sanitizeFontName( aFont->GetName() ) : std::string( "Font" );
385 return fmt::format( "{}+{}", prefix, name );
386}
387
392
394{
395 m_subsets.clear();
397}
398
400{
401 if( !aFont )
402 return nullptr;
403 SUBSET_KEY key{ aFont, aItalic, aBold };
404 auto it = m_subsets.find( key );
405 if( it != m_subsets.end() )
406 return it->second.get();
407 auto subset = std::make_unique<PDF_OUTLINE_FONT_SUBSET>( aFont, m_nextSubsetIndex++ );
408 PDF_OUTLINE_FONT_SUBSET* subsetPtr = subset.get();
409
410 // Synthetic style application: if requested styles not actually present in font face flags.
411 // Distinguish real face style from fake style flags so that a fake italic does not block
412 // PDF shear application. We consider the face to have a real italic only if FT_STYLE_FLAG_ITALIC
413 // is set. (m_fakeItal only indicates substitution missing an italic variant.)
414 bool faceHasRealItalic = false;
415 bool faceHasRealBold = false;
416 if( const FT_Face& face = aFont->GetFace() )
417 {
418 faceHasRealItalic = ( face->style_flags & FT_STYLE_FLAG_ITALIC ) != 0;
419 faceHasRealBold = ( face->style_flags & FT_STYLE_FLAG_BOLD ) != 0;
420 }
421
422 bool needSyntheticItalic = aItalic && !faceHasRealItalic; // ignore fake italic
423 bool needSyntheticBold = aBold && !faceHasRealBold; // ignore fake bold
424
425 if( std::getenv( "KICAD_DEBUG_SYN_STYLE" ) )
426 {
427 const FT_Face& face = aFont->GetFace();
428 int styleFlags = face ? face->style_flags : 0;
429 const char* fname = aFont->GetName().ToUTF8().data();
430 const char* styleName = ( face && face->style_name ) ? face->style_name : "(null)";
431 bool fakeItal = static_cast<KIFONT::OUTLINE_FONT*>( aFont )->IsFakeItalic();
432 bool fakeBold = static_cast<KIFONT::OUTLINE_FONT*>( aFont )->IsFakeBold();
433 wxLogTrace( tracePdfPlotter,
434 "ensureSubset font='%s' styleName='%s' reqItalic=%d reqBold=%d FT_style_flags=%d "
435 "faceHasRealItalic=%d faceHasRealBold=%d fakeItal=%d fakeBold=%d syntheticItalic=%d "
436 "syntheticBold=%d subsetKey[i=%d b=%d] subsetIdx=%u",
437 fname ? fname : "(null)", styleName, (int) aItalic, (int) aBold, styleFlags,
438 (int) faceHasRealItalic, (int) faceHasRealBold, (int) fakeItal, (int) fakeBold,
439 (int) needSyntheticItalic, (int) needSyntheticBold, (int) aItalic, (int) aBold,
440 subsetPtr->Font()->GetFace() ? subsetPtr->Font()->GetFace()->face_index : 0 );
441 }
442
443 if( needSyntheticItalic || needSyntheticBold )
444 {
445 // Approx italic angle based on shear ITALIC_TILT (radians) => degrees
446 double angleDeg = -std::atan( ITALIC_TILT ) * 180.0 / M_PI; // negative for conventional PDF italicAngle
447 subsetPtr->ForceSyntheticStyle( needSyntheticBold, needSyntheticItalic, angleDeg );
448 if( std::getenv( "KICAD_DEBUG_SYN_STYLE" ) )
449 {
450 wxLogTrace( tracePdfPlotter, "ForceSyntheticStyle applied: bold=%d italic=%d angle=%f", (int) needSyntheticBold, (int) needSyntheticItalic, angleDeg );
451 }
452 }
453
454 m_subsets.emplace( key, std::move( subset ) );
455 return subsetPtr;
456}
457
459 bool aItalicRequested, bool aBoldRequested,
460 std::vector<PDF_OUTLINE_FONT_RUN>* aRuns )
461{
462 if( !aRuns || !aFont )
463 return;
464
466
469 {
470 return;
471 }
472
473 // If italic requested and font has a dedicated italic variant discoverable via style linkage,
474 // the caller should already have selected that font (aFont). We still separate subsets by
475 // italic flag so synthetic slant and regular do not share widths.
476 PDF_OUTLINE_FONT_SUBSET* subset = ensureSubset( aFont, aItalicRequested, aBoldRequested );
477
478 if( !subset )
479 return;
480
481 UTF8 utf8Text( aText );
482 std::string textUtf8 = utf8Text.substr();
483
484 hb_buffer_t* buffer = hb_buffer_create();
485 hb_buffer_set_cluster_level( buffer, HB_BUFFER_CLUSTER_LEVEL_MONOTONE_GRAPHEMES );
486 hb_buffer_add_utf8( buffer, textUtf8.c_str(), (int) textUtf8.size(), 0, (int) textUtf8.size() );
487 hb_buffer_guess_segment_properties( buffer );
488
489 hb_font_t* hbFont = hb_ft_font_create_referenced( aFont->GetFace() );
490 hb_ft_font_set_funcs( hbFont );
491 hb_shape( hbFont, buffer, nullptr, 0 );
492
493 unsigned int glyphCount = 0;
494 hb_glyph_info_t* glyphInfo = hb_buffer_get_glyph_infos( buffer, &glyphCount );
495 hb_glyph_position_t* glyphPos = hb_buffer_get_glyph_positions( buffer, &glyphCount );
496
497 hb_font_destroy( hbFont );
498
499 if( glyphCount == 0 )
500 {
501 hb_buffer_destroy( buffer );
502 return;
503 }
504
506 run.m_subset = subset;
507
508 bool hasVisibleGlyph = false;
509
510 for( unsigned int ii = 0; ii < glyphCount; ++ii )
511 {
512 uint32_t glyphIndex = glyphInfo[ii].codepoint;
513
514 size_t clusterStart = glyphInfo[ii].cluster;
515 size_t clusterEnd = ( ii + 1 < glyphCount ) ? glyphInfo[ii + 1].cluster : textUtf8.size();
516
517 if( clusterEnd < clusterStart )
518 std::swap( clusterStart, clusterEnd );
519
520 std::string clusterUtf8 = textUtf8.substr( clusterStart, clusterEnd - clusterStart );
521 std::u32string unicode = utf8ToU32( clusterUtf8 );
522
523 if( unicode.empty() )
524 unicode.push_back( 0 );
525
526 uint16_t cid = subset->EnsureGlyph( glyphIndex, unicode );
527
528 if( cid != 0 )
529 hasVisibleGlyph = true;
530
531 run.m_bytes.push_back( static_cast<char>( ( cid >> 8 ) & 0xFF ) );
532 run.m_bytes.push_back( static_cast<char>( cid & 0xFF ) );
533
534 // Capture HarfBuzz positioning information and convert to PDF units
536 glyph.cid = cid;
537 // Convert from 26.6 fixed point to font units, then to PDF units
538 double xAdvanceFontUnits = glyphPos[ii].x_advance / 64.0;
539 double yAdvanceFontUnits = glyphPos[ii].y_advance / 64.0;
540 double xOffsetFontUnits = glyphPos[ii].x_offset / 64.0;
541 double yOffsetFontUnits = glyphPos[ii].y_offset / 64.0;
542
543 glyph.xAdvance = unitsToPdf( xAdvanceFontUnits, subset->UnitsPerEm() );
544 glyph.yAdvance = unitsToPdf( yAdvanceFontUnits, subset->UnitsPerEm() );
545 glyph.xOffset = unitsToPdf( xOffsetFontUnits, subset->UnitsPerEm() );
546 glyph.yOffset = unitsToPdf( yOffsetFontUnits, subset->UnitsPerEm() );
547 run.m_glyphs.push_back( glyph );
548 }
549
550 hb_buffer_destroy( buffer );
551
552 if( hasVisibleGlyph && !run.m_bytes.empty() )
553 aRuns->push_back( std::move( run ) );
554}
555
556std::vector<PDF_OUTLINE_FONT_SUBSET*> PDF_OUTLINE_FONT_MANAGER::AllSubsets() const
557{
558 std::vector<PDF_OUTLINE_FONT_SUBSET*> result;
559 result.reserve( m_subsets.size() );
560
561 for( const auto& [ font, subset ] : m_subsets )
562 {
563 if( subset )
564 result.push_back( subset.get() );
565 }
566
567 return result;
568}
const char * name
const wxString & GetName() const
Definition font.h:112
Implement outline font drawing.
const FT_Face & GetFace() const
bool IsItalic() const override
EMBEDDING_PERMISSION GetEmbeddingPermission() const
bool IsBold() const override
std::map< SUBSET_KEY, std::unique_ptr< PDF_OUTLINE_FONT_SUBSET > > m_subsets
void EncodeString(const wxString &aText, KIFONT::OUTLINE_FONT *aFont, bool aItalicRequested, bool aBoldRequested, std::vector< PDF_OUTLINE_FONT_RUN > *aRuns)
PDF_OUTLINE_FONT_SUBSET * ensureSubset(KIFONT::OUTLINE_FONT *aFont, bool aItalic, bool aBold)
std::vector< PDF_OUTLINE_FONT_SUBSET * > AllSubsets() const
std::vector< std::u32string > m_cidToUnicode
std::string BuildToUnicodeCMap() const
uint16_t EnsureGlyph(uint32_t aGlyphIndex, const std::u32string &aUnicode)
std::vector< double > m_widths
KIFONT::OUTLINE_FONT * m_font
std::vector< uint8_t > m_fontData
std::vector< uint16_t > m_cidToGid
static std::string makeSubsetName(KIFONT::OUTLINE_FONT *aFont, unsigned aSubsetIndex)
static std::string sanitizeFontName(const wxString &aName)
const std::vector< uint8_t > & FontFileData()
PDF_OUTLINE_FONT_SUBSET(KIFONT::OUTLINE_FONT *aFont, unsigned aSubsetIndex)
std::string BuildWidthsArray() const
KIFONT::OUTLINE_FONT * Font() const
static std::string makeResourceName(unsigned aSubsetIndex)
std::map< GLYPH_KEY, uint16_t > m_glyphMap
void ForceSyntheticStyle(bool aBold, bool aItalic, double aItalicAngleDeg)
std::string BuildCIDToGIDStream() const
An 8 bit string that is assuredly encoded in UTF8, and supplies special conversion support to and fro...
Definition utf8.h:67
std::string substr(size_t pos=0, size_t len=npos) const
Definition utf8.h:201
static bool empty(const wxTextEntryBase *aCtrl)
static constexpr double ITALIC_TILT
Tilt factor for italic style (this is the scaling factor on dY relative coordinates to give a tilted ...
Definition font.h:58
const wxChar *const tracePdfPlotter
Flag to enable PDF plotter debug tracing.
std::string FormatPdfUtf16Hex(uint32_t aCodepoint)
Format one Unicode code point as the hex digits of its UTF-16BE representation.
PDF_OUTLINE_FONT_SUBSET * m_subset
std::vector< PDF_OUTLINE_FONT_GLYPH > m_glyphs
bool operator<(const GLYPH_KEY &aOther) const
wxString result
Test unit parsing edge cases and error handling.
#define M_PI
wxLogTrace helper definitions.