MCPcopy Index your code
hub / github.com/benfry/processing4 / width

Method width

core/src/processing/core/PFont.java:704–711  ·  view source on GitHub ↗

Width of this character for a font of size 1.

(char c)

Source from the content-addressed store, hash-verified

702 * Width of this character for a font of size 1.
703 */
704 public float width(char c) {
705 if (c == 32) return width('i');
706
707 int cc = index(c);
708 if (cc == -1) return 0;
709
710 return ((float) glyphs[cc].setWidth / (float) size);
711 }
712
713
714 //////////////////////////////////////////////////////////////

Callers 1

textWidthImplMethod · 0.80

Calls 1

indexMethod · 0.95

Tested by

no test coverage detected