MCPcopy Index your code
hub / github.com/processing/processing / Font

Method Font

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

Source from the content-addressed store, hash-verified

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