MCPcopy Create free account
hub / github.com/axmolengine/axmol / parseKerningEntry

Method parseKerningEntry

core/2d/FontFNT.cpp:510–530  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

508}
509
510void BMFontConfiguration::parseKerningEntry(const char* line)
511{
512 //////////////////////////////////////////////////////////////////////////
513 // line to parse:
514 // kerning first=121 second=44 amount=-7
515 //////////////////////////////////////////////////////////////////////////
516
517 int first, second, amount;
518 auto tmp = strstr(line, "first=") + 6;
519 sscanf(tmp, "%d", &first);
520
521 tmp = strstr(tmp, "second=") + 7;
522 sscanf(tmp, "%d", &second);
523
524 tmp = strstr(tmp, "amount=") + 7;
525 sscanf(tmp, "%d", &amount);
526
527 uint64_t key = ((uint64_t)first << 32) | ((uint64_t)second & 0xffffffffll);
528
529 _kerningDictionary[key] = amount;
530}
531
532FontFNT* FontFNT::create(std::string_view fntFilePath, const Rect& imageRect, bool imageRotated)
533{

Callers 1

parseConfigFileMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected