Shows all system fonts that contain given character.
10412
def char(self, char):
        
        font_files = fc.query()
        if self._display['group']:
            font_files = self._getCharFont(font_files, char)
            font_families = self._groupFontByFamily(font_files)
            for font_family in sorted(font_families):
                print(font_family)
                if self._display['list']:
                    for font_file in font_families[font_family]:
                        print('  '+font_file)
            self._fontSummary(len(font_files), len(font_families))
        else:
            font_files = self._getCharFont(font_files, char)
            for font_file in sorted(font_files):
                print(font_file)
            self._fontSummary(len(font_files))
488377
def com_google_fonts_check_fsselection(ttFont, style):
  """"""
  from fontbakery.utils import check_bit_entry
  from fontbakery.constants import (STATIC_STYLE_NAMES,
                                    RIBBI_STYLE_NAMES,
                                    FsSelection)

  # Checking fsSelection REGULAR bit:
  expected = "Regular" in style or \
             (style in STATIC_STYLE_NAMES and
              style not in RIBBI_STYLE_NAMES and
              "Italic" not in style)
  yield check_bit_entry(ttFont, "OS/2", "fsSelection",
                        expected,
                        bitmask=FsSelection.REGULAR,
                        bitname="REGULAR")

  # Checking fsSelection ITALIC bit:
  expected = "Italic" in style
  yield check_bit_entry(ttFont, "OS/2", "fsSelection",
                        expected,
                        bitmask=FsSelection.ITALIC,
                        bitname="ITALIC")

  # Checking fsSelection BOLD bit:
  expected = style in ["Bold", "BoldItalic"]
  yield check_bit_entry(ttFont, "OS/2", "fsSelection",
                        expected,
                        bitmask=FsSelection.BOLD,
                        bitname="BOLD")
51880
def characters(self, numberOfCharacters):
        """"""
        return self.code[self.index:self.index + numberOfCharacters]
1050137
def _font_directories(cls):
        
        if sys.platform.startswith('darwin'):
            return cls._os_x_font_directories()
        if sys.platform.startswith('win32'):
            return cls._windows_font_directories()
        raise OSError('unsupported operating system')
939706
def com_google_fonts_check_currency_chars(ttFont):
  """"""

  def font_has_char(ttFont, codepoint):
    for subtable in ttFont['cmap'].tables:
      if codepoint in subtable.cmap:
        return True
    #otherwise
    return False

  failed = False

  OPTIONAL = {
    #TODO: Do we want to check for this one?
    #0x20A0: "EUROPEAN CURRENCY SIGN"
  }
  MANDATORY = {
    0x20AC: "EURO SIGN"
    # TODO: extend this list
  }
  for codepoint, charname in OPTIONAL.items():
    if not font_has_char(ttFont, codepoint):
      failed = True
      yield WARN, f"Font lacks \"{charname}\" character (unicode: 0x{codepoint:04X})"

  for codepoint, charname in MANDATORY.items():
    if not font_has_char(ttFont, codepoint):
      failed = True
      yield FAIL, f"Font lacks \"{charname}\" character (unicode: 0x{codepoint:04X})"

  if not failed:
    yield PASS, "Font has all expected currency sign characters."
952846
def char(i):
    

    i = ord(i)
    if i not in font:
        return [(0,)] * 8
    return [(ord(row),) for row in font[i].decode('hex')]
897362
def _font_of_mention(m):
    
    for ch in m:
        if isinstance(ch, LTChar) and ch.get_text().isalnum():
            return (ch.fontname, _font_size_of(ch))
    return (None, 0)
1312698
def com_google_fonts_check_name_unwanted_chars(ttFont):
  """"""
  failed = False
  replacement_map = [("\u00a9", '(c)'),
                     ("\u00ae", '(r)'),
                     ("\u2122", '(tm)')]
  for name in ttFont['name'].names:
    string = str(name.string, encoding=name.getEncoding())
    for mark, ascii_repl in replacement_map:
      new_string = string.replace(mark, ascii_repl)
      if string != new_string:
        yield FAIL, ("NAMEID #{} contains symbol that should be"
                     " replaced by '{}'.").format(name.nameID,
                                                  ascii_repl)
        failed = True
  if not failed:
    yield PASS, ("No need to substitute copyright, registered and"
                 " trademark symbols in name table entries of this font.")
671304
public static FontData[] getAllFonts() {
		if (fonts == null) {
			fonts = new ArrayList();
			
			String os = System.getProperty("os.name");
			File[] locs = new File[0];
			
			if (os.startsWith("Windows")) {
				locs = win32;
			}
			if (os.startsWith("Linux")) {
				locs = linux;
			}
			if (os.startsWith("Mac OS")) {
				locs = macos;
			}
			
			for (int i=0;i<locs.length;i++) {
				File loc = locs[i];
			
				processFontDirectory(loc, fonts);
			}

			if (os.startsWith("Linux")) {
				locateLinuxFonts(new File("/etc/fonts/fonts.conf"));
			}
		}
		
		
		return (FontData[]) fonts.toArray(new FontData[0]);
	}
1326942
function findFont(family) {
    if(_fonts[family]) return _fonts[family];
    family =  Object.keys(_fonts)[0];
    return _fonts[family];
}
1202724
def FontForLabels(self, dc):
        '''  '''
        font = wx.SystemSettings_GetFont(wx.SYS_DEFAULT_GUI_FONT)
        scale = dc.GetPPI()[0] / wx.ScreenDC().GetPPI()[0]
        font.SetPointSize(scale*font.GetPointSize())
        return font
797334
def match(self, chars):
        """"""
        start_index = self.next_index
        for char in self:
            if char not in chars:
                self.next_index -= 1
                break
        return self[start_index:self.next_index]
1076765
def getFontFace(self):
        """"""
        userFace = self.buildSpec['terminal_font_family'] or self.defaultFont.GetFaceName()
        return (''
                if self.buildSpec['monospace_display']
                else userFace)
108877
private boolean containsAll(String s, int i) {
        if (i >= s.length()) {
            return true;
        }
        int  cp= UTF16.charAt(s, i);
        if (contains(cp) && containsAll(s, i+UTF16.getCharCount(cp))) {
            return true;
        }
        for (String setStr : strings) {
            if (s.startsWith(setStr, i) &&  containsAll(s, i+setStr.length())) {
                return true;
            }
        }
        return false;

    }
670795
def _get_char_x(self, charno):
        
        return charno * self.fontw + self.image_pad + self.line_number_width
1208907
function filterBetaCharacters (characters) {
  /* istanbul ignore next */
  if (!characters) {
    return null
  }

  return characters.filter(x => !x.flags || !x.flags.includes('Beta'))
}
379981
def _is_control(self, char):
        """"""
        # These are technically control characters but we count them as whitespace
        # characters.
        if char in ['\t', '\n', '\r']:
            return False
        cat = unicodedata.category(char)
        if cat.startswith('C'):
            return True
        return False