(options)
| 1553 | // It contains a set of glyphs and methods to draw text on a drawing context, |
| 1554 | // or to get a path representing the text. |
| 1555 | function Font(options) { |
| 1556 | options = options || {}; |
| 1557 | |
| 1558 | // OS X will complain if the names are empty, so we put a single space everywhere by default. |
| 1559 | this.names = { |
| 1560 | fontFamily: {en: options.familyName || ' '}, |
| 1561 | fontSubfamily: {en: options.styleName || ' '}, |
| 1562 | designer: {en: options.designer || ' '}, |
| 1563 | designerURL: {en: options.designerURL || ' '}, |
| 1564 | manufacturer: {en: options.manufacturer || ' '}, |
| 1565 | manufacturerURL: {en: options.manufacturerURL || ' '}, |
| 1566 | license: {en: options.license || ' '}, |
| 1567 | licenseURL: {en: options.licenseURL || ' '}, |
| 1568 | version: {en: options.version || 'Version 0.1'}, |
| 1569 | description: {en: options.description || ' '}, |
| 1570 | copyright: {en: options.copyright || ' '}, |
| 1571 | trademark: {en: options.trademark || ' '} |
| 1572 | }; |
| 1573 | this.unitsPerEm = options.unitsPerEm || 1000; |
| 1574 | this.ascender = options.ascender; |
| 1575 | this.descender = options.descender; |
| 1576 | this.supported = true; // Deprecated: parseBuffer will throw an error if font is not supported. |
| 1577 | this.glyphs = new glyphset.GlyphSet(this, options.glyphs || []); |
| 1578 | this.encoding = new encoding.DefaultEncoding(this); |
| 1579 | this.tables = {}; |
| 1580 | } |
| 1581 | |
| 1582 | // Check if the font has a glyph for the given character. |
| 1583 | Font.prototype.hasChar = function(c) { |
nothing calls this directly
no outgoing calls
no test coverage detected