def spawn_fontspec_from_fcfont(self, fcfont, char): print "New fontspec '%s' matching U%X from fontconfig" % (fcfont.family, ord(char)) # Create a new font fontspec = FontSpec() fontspec.id = fcfont.family fontspec.transitions["enter"]["main"] = fcfont.family fontspec.add_char(char) # Register the font and its related fontconfig object self.fccache[fcfont.name] = fcfont self.add_subfont(fontspec) return fontspec
def spawn_fontspec_from_fcfonts(self, fcfonts, char): self.log.info("New fontspec '%s' matching U%X from fontconfig"\ % (fcfonts["serif"].family, ord(char))) # Create a new font fontspec = FontSpec() fontspec.id = fcfont.family fontspec.transitions["enter"]["main"] = fcfonts["serif"].family fontspec.transitions["enter"]["sans"] = fcfonts["sans-serif"].family fontspec.transitions["enter"]["mono"] = fcfonts["monospace"].family fontspec.add_char(char) fontspec.add_ignored(self._ignored) # Register the font and its related fontconfig object for fcfont in fcfonts.values(): self.fccache[fcfont.name] = fcfont self.add_subfont(fontspec) return fontspec