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

Method Font

core/src/processing/core/PShapeSVG.java:1799–1838  ·  view source on GitHub ↗
(PShapeSVG parent, XML properties)

Source from the content-addressed store, hash-verified

1797
1798
1799 public Font(PShapeSVG parent, XML properties) {
1800 super(parent, properties, false);
1801// handle(parent, properties);
1802
1803 XML[] elements = properties.getChildren();
1804
1805 horizAdvX = properties.getInt("horiz-adv-x", 0);
1806
1807 namedGlyphs = new HashMap<>();
1808 unicodeGlyphs = new HashMap<>();
1809 glyphCount = 0;
1810 glyphs = new FontGlyph[elements.length];
1811
1812 for (int i = 0; i < elements.length; i++) {
1813 String name = elements[i].getName();
1814 XML elem = elements[i];
1815 if (name == null) {
1816 // skip it
1817 } else if (name.equals("glyph")) {
1818 FontGlyph fg = new FontGlyph(this, elem, this);
1819 if (fg.isLegit()) {
1820 if (fg.name != null) {
1821 namedGlyphs.put(fg.name, fg);
1822 }
1823 if (fg.unicode != 0) {
1824 unicodeGlyphs.put(Character.valueOf(fg.unicode), fg);
1825 }
1826 }
1827 glyphs[glyphCount++] = fg;
1828
1829 } else if (name.equals("missing-glyph")) {
1830// System.out.println("got missing glyph inside <font>");
1831 missingGlyph = new FontGlyph(this, elem, this);
1832 } else if (name.equals("font-face")) {
1833 face = new FontFace(this, elem);
1834 } else {
1835 System.err.println("Ignoring " + name + " inside <font>");
1836 }
1837 }
1838 }
1839
1840
1841 protected void drawShape() {

Callers

nothing calls this directly

Calls 7

isLegitMethod · 0.95
getIntMethod · 0.65
getChildrenMethod · 0.45
getNameMethod · 0.45
equalsMethod · 0.45
putMethod · 0.45
printlnMethod · 0.45

Tested by

no test coverage detected