extractFont(self, xref=0, info_only=0) -> PyObject *
488939
def extractFont(self, xref=0, info_only=0):
        """"""
        if self.isClosed or self.isEncrypted:
            raise ValueError("operation illegal for closed / encrypted doc")

        return _fitz.Document_extractFont(self, xref, info_only)
1204390
def loadinfofont(self):
        """"""
        if self.infofont == None:
            self.infofont = imft.load_path(os.path.join(fontsdir, "courR10.pil"))
189515
def logpdf(self, x):
        
        if self.transform is not None:
            x = self.transform(x)       
        return (-self.alpha-1)*np.log(x) - (self.beta/float(x))
456444
def extractGlyph(self, glyph, pointPen=None, onlyGeometry=False):
        
        if pointPen is None:
            pointPen = glyph.getPointPen()
        glyph.clearContours()
        glyph.clearComponents()
        glyph.clearAnchors()
        glyph.clearGuidelines()
        glyph.lib.clear()
        cleanerPen = FilterRedundantPointPen(pointPen)
        self.drawPoints(cleanerPen)
        glyph.anchors = [dict(anchor) for anchor in self.anchors]
        glyph.guidelines = [_compressGuideline(guideline) for guideline in self.guidelines]
        glyph.image = _compressImage(self.image)
        glyph.lib = deepcopy(dict(self.lib))
        glyph.width = self.width
        glyph.height = self.height
        glyph.note = self.note
        if not onlyGeometry:
            glyph.name = self.name
            glyph.unicodes = list(self.unicodes)
        return glyph
811589
private function readFont()
    {
        $length = self::getInt2d($this->data, $this->pos + 2);
        $recordData = $this->readRecordData($this->data, $this->pos + 4, $length);

        // move stream pointer to next record
        $this->pos += 4 + $length;

        if (!$this->readDataOnly) {
            $objFont = new PHPExcel_Style_Font();

            // offset: 0; size: 2; height of the font (in twips = 1/20 of a point)
            $size = self::getInt2d($recordData, 0);
            $objFont->setSize($size / 20);

            // offset: 2; size: 2; option flags
            // bit: 0; mask 0x0001; bold (redundant in BIFF5-BIFF8)
            // bit: 1; mask 0x0002; italic
            $isItalic = (0x0002 & self::getInt2d($recordData, 2)) >> 1;
            if ($isItalic) {
                $objFont->setItalic(true);
            }

            // bit: 2; mask 0x0004; underlined (redundant in BIFF5-BIFF8)
            // bit: 3; mask 0x0008; strike
            $isStrike = (0x0008 & self::getInt2d($recordData, 2)) >> 3;
            if ($isStrike) {
                $objFont->setStrikethrough(true);
            }

            // offset: 4; size: 2; colour index
            $colorIndex = self::getInt2d($recordData, 4);
            $objFont->colorIndex = $colorIndex;

            // offset: 6; size: 2; font weight
            $weight = self::getInt2d($recordData, 6);
            switch ($weight) {
                case 0x02BC:
                    $objFont->setBold(true);
                    break;
            }

            // offset: 8; size: 2; escapement type
            $escapement = self::getInt2d($recordData, 8);
            switch ($escapement) {
                case 0x0001:
                    $objFont->setSuperScript(true);
                    break;
                case 0x0002:
                    $objFont->setSubScript(true);
                    break;
            }

            // offset: 10; size: 1; underline type
            $underlineType = ord($recordData{10});
            switch ($underlineType) {
                case 0x00:
                    break; // no underline
                case 0x01:
                    $objFont->setUnderline(PHPExcel_Style_Font::UNDERLINE_SINGLE);
                    break;
                case 0x02:
                    $objFont->setUnderline(PHPExcel_Style_Font::UNDERLINE_DOUBLE);
                    break;
                case 0x21:
                    $objFont->setUnderline(PHPExcel_Style_Font::UNDERLINE_SINGLEACCOUNTING);
                    break;
                case 0x22:
                    $objFont->setUnderline(PHPExcel_Style_Font::UNDERLINE_DOUBLEACCOUNTING);
                    break;
            }

            // offset: 11; size: 1; font family
            // offset: 12; size: 1; character set
            // offset: 13; size: 1; not used
            // offset: 14; size: var; font name
            if ($this->version == self::XLS_BIFF8) {
                $string = self::readUnicodeStringShort(substr($recordData, 14));
            } else {
                $string = $this->readByteStringShort(substr($recordData, 14));
            }
            $objFont->setName($string['value']);

            $this->objFonts[] = $objFont;
        }
    }
589795
def text(self):
        
        if self.out:
            self.out.close()  # pragma: nocover
        return self.fp.getvalue()
1076060
def _getFont(self, font):
        
        if os.path.isfile(font):
            font_files = [font]
        else:
            font_files = fc.query(family=font)
            if not font_files:
                raise ValueError('No such font')
        return font_files
30313
def get_font(name = :Helvetica)
      initiate_library
      font = FONTS_LIBRARY[name]
      return nil unless font
      font = font.dup
      font[:referenced_object] = font[:referenced_object].dup if font[:referenced_object]
      font
    end
955638
def _from_pointer(pointer, incref):
        
        if pointer == ffi.NULL:
            raise ValueError('Null pointer')
        if incref:
            cairo.cairo_scaled_font_reference(pointer)
        self = object.__new__(ScaledFont)
        ScaledFont._init_pointer(self, pointer)
        return self
1127431
def selection(self):
        
        if self._font.get() is "" or self._font.get() not in self._fonts:
            return None
        else:
            return self._font.get()
1320128
def get_font(self, font):
        
        font = {'a': 0, 'b': 1}.get(font, font)
        if not six.text_type(font) in self.fonts:
            raise NotSupported(
                '"{}" is not a valid font in the current profile'.format(font))
        return font
1295393
@Nullable
    public static ITypeface findFont(@NonNull Context ctx, @NonNull String key) {
        init(ctx);
        return FONTS.get(key);
    }
809379
def get_output_original(self):
        
        with open(self.file, "r") as f:
            temp = float(f.read().strip()) / 1000

        if self.dynamic_color:
            perc = int(self.percentage(int(temp), self.alert_temp))
            if (perc > 99):
                perc = 99
            color = self.colors[perc]
        else:
            color = self.color if temp < self.alert_temp else self.alert_color
        return {
            "full_text": self.format.format(temp=temp),
            "color": color,
        }
1291095
def copy(string, xsel=False):
    """"""
    try:
        _cmd = ["xclip", "-selection", "clipboard"]
        subprocess.Popen(_cmd, stdin=subprocess.PIPE).communicate(
                string.encode('utf-8'))
        if xsel:
            _cmd = ["xclip", "-selection", "primary"]
            subprocess.Popen(_cmd, stdin=subprocess.PIPE).communicate(
                    string.encode('utf-8'))
    except OSError as why:
        raise XclipNotFound
1307722
def _get_index(self):
        
        glyph = self.glyph
        if glyph is None:
            return None
        return glyph.anchors.index(self)
1295402
def extract_type(s):
    """"""
    r = re.compile(r"<class '(.*)'>", re.MULTILINE | re.IGNORECASE)
    try:
        m = r.match(str(s)).group(1)
    except (IndexError, AttributeError) as e:
        m = None

    return m
670795
def _get_char_x(self, charno):
        
        return charno * self.fontw + self.image_pad + self.line_number_width