MCPcopy Create free account
hub / github.com/ClassiCube/ClassiCube / Fallback_CellWidth

Function Fallback_CellWidth

src/SystemFonts.c:148–158  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

146};
147
148static int Fallback_CellWidth(const cc_uint8* rows) {
149 int y, width, widest = 0;
150
151 for (y = 0; y < CELL_SIZE; y++)
152 {
153 widest = max(widest, rows[y]);
154 }
155 width = Math_ilog2(widest) + 1;
156
157 return width + 1; /* add 1 for padding */
158}
159
160int FallbackFont_TextWidth(const struct DrawTextArgs* args) {
161 cc_string left = args->text, part;

Callers 3

FallbackFont_TextWidthFunction · 0.85
FallbackFont_DrawTextFunction · 0.85
FallbackFont_PlotFunction · 0.85

Calls 1

Math_ilog2Function · 0.85

Tested by

no test coverage detected