MCPcopy Create free account
hub / github.com/crosspoint-reader/crosspoint-reader / getKerning

Method getKerning

lib/GfxRenderer/GfxRenderer.cpp:1593–1599  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1591}
1592
1593int GfxRenderer::getKerning(const int fontId, const uint32_t leftCp, const uint32_t rightCp,
1594 const EpdFontFamily::Style style) const {
1595 const auto fontIt = fontMap.find(fontId);
1596 if (fontIt == fontMap.end()) return 0;
1597 const int kernFP = fontIt->second.getKerning(leftCp, rightCp, style); // 4.4 fixed-point
1598 return fp4::toPixel(kernFP); // snap 4.4 fixed-point to nearest pixel
1599}
1600
1601int GfxRenderer::getTextAdvanceX(const int fontId, const char* text, EpdFontFamily::Style style) const {
1602 // Advance table fast-path for SD card fonts during layout.

Callers 4

drawTextMethod · 0.45
getSpaceAdvanceMethod · 0.45
getTextAdvanceXMethod · 0.45
drawTextRotated90CWMethod · 0.45

Calls 2

toPixelFunction · 0.85
endMethod · 0.80

Tested by

no test coverage detected