Lines Matching defs:font

784 	var $CoreFonts; // array of standard font names
786 var $FontFiles; // array of font files
793 var $FontFamily; // current font family
794 var $FontStyle; // current font style
795 var $CurrentFont; // current font info
796 var $FontSizePt; // current font size in points
797 var $FontSize; // current font size in user unit
3231 // Set font
3256 // Restore font
3507 // Get width of a single character in the current Core font
3538 // Get width of a single character in the current Non-Core font
3609 // Get width of a string in the current font
3829 // check if the font has been already added
3858 $font = [
3887 $font = $this->fontCache->jsonLoad($fontCacheFilename);
3898 if ($BMPonly && !$font['BMPselected']) {
3900 } elseif (!$BMPonly && $font['BMPselected']) {
3904 if ($fontUseOTL && $font['useOTL'] != $fontUseOTL) {
3906 $font['useOTL'] = $fontUseOTL;
3907 } elseif (!$fontUseOTL && $font['useOTL']) {
3909 $font['useOTL'] = 0;
3912 if ($this->fontDescriptor != $font['fontmetrics']) {
3916 if (empty($font['name']) || $font['originalsize'] != $ttfstat['size'] || $regenerate) {
3926 $font['useOTL'],
3930 $font = $this->fontCache->jsonLoad($fontCacheFilename);
3964 'name' => $font['name'],
3965 'type' => $font['type'],
3966 'desc' => $font['desc'],
3967 'panose' => $font['panose'],
3968 'unitsPerEm' => $font['unitsPerEm'],
3969 'up' => $font['up'],
3970 'ut' => $font['ut'],
3971 'strs' => $font['strs'],
3972 'strp' => $font['strp'],
3977 'sip' => $font['sip'],
3979 'smp' => $font['smp'],
3983 'GSUBScriptLang' => $font['GSUBScriptLang'],
3984 'GSUBFeatures' => $font['GSUBFeatures'],
3985 'GSUBLookups' => $font['GSUBLookups'],
3986 'GPOSScriptLang' => $font['GPOSScriptLang'],
3987 'GPOSFeatures' => $font['GPOSFeatures'],
3988 'GPOSLookups' => $font['GPOSLookups'],
3989 'rtlPUAstr' => $font['rtlPUAstr'],
3991 'haskerninfo' => $font['haskerninfo'],
3992 'haskernGPOS' => $font['haskernGPOS'],
3993 'hassmallcapsGSUB' => $font['hassmallcapsGSUB'],
3997 if (!$font['sip'] && !$font['smp']) {
4005 if ($font['haskerninfo']) {
4006 $this->fonts[$fontkey]['kerninfo'] = $font['kerninfo'];
4010 'length1' => $font['originalsize'],
4013 'sip' => $font['sip'],
4014 'smp' => $font['smp'],
4046 throw new \Mpdf\MpdfException("No font or default font set!");
4059 $this->PDFAXwarnings[] = "Core Adobe font " . ucfirst($family) . " cannot be embedded in mPDF, which is required for PDFA1-b or PDFX/1-a. (Embedded font will be substituted.)";
4113 } else { // Test to see if requested font/style is available - or substitute /* -- END CJK-FONTS -- */
4115 // If font[nostyle] exists - set it
4118 } // elseif only one font available - set it (assumes if only one font available it will not have a style)
4124 // else substitute font of similar type
4161 // set first available font
4184 // try to add font (if not already added)
4187 // Test if font is already selected
4219 // Test if font is already selected
4244 require __DIR__ . '/../data/font/' . $file . '.php';
4246 throw new \Mpdf\MpdfException(sprintf('Could not include font metric file "%s"', $file));
4258 // Test if font is already selected
4286 // Set font size in points
5494 // font-related size
6420 $this->flowingBlockAttr['font'] = [];
6447 $font = & $this->flowingBlockAttr['font'];
6537 $this->_setInlineBlockHeights($lineBox, $stackHeight, $content, $font, $is_table);
6555 $this->restoreFont($font[$k], false);
6584 if (isset($font[count($font) - 1])) {
6585 $lastfontreqstyle = (isset($font[count($font) - 1]['ReqFontStyle']) ? $font[count($font) - 1]['ReqFontStyle'] : '');
6586 $lastfontstyle = (isset($font[count($font) - 1]['style']) ? $font[count($font) - 1]['style'] : '');
6752 $this->restoreFont($font[$k], false);
6777 // $this->objectbuffer and $font ($chunkorder contains the mapping)
6786 $this->restoreFont($font[$k], false);
6831 $this->restoreFont($font[$chunkorder[count($chunkorder) - 1]], false);
6919 $this->restoreFont($font[$k]); // mPDF 5.7
7752 $font = & $this->flowingBlockAttr['font'];
7767 $font[] = $this->saveFont();
8174 $savedPreFont[] = array_pop($font);
8184 $savedPreFont[] = $font[$cutcontentctr];
8196 array_pop($font);
8243 array_pop($font);
8277 $this->_setInlineBlockHeights($lineBox, $stackHeight, $content, $font, $is_table);
8294 $this->restoreFont($font[$k], false);
8333 $lastfontreqstyle = (isset($font[count($font) - 1]['ReqFontStyle']) ? $font[count($font) - 1]['ReqFontStyle'] : '');
8334 $lastfontstyle = (isset($font[count($font) - 1]['style']) ? $font[count($font) - 1]['style'] : '');
8353 // $this->objectbuffer and $font ($chunkorder contains the mapping)
8360 $this->restoreFont($font[$k], false);
8552 $this->restoreFont($font[$k]); // mPDF 5.7
8669 $font = [];
8676 $font[] = $savedFont;
8684 $font[] = $savedPreFont[$ix];
8712 $font[] = $savedFont;
8719 $this->restoreFont($font[(count($font) - 1)]); // mPDF 6.0
9949 // Remove references to unused fonts (usually default font)
9950 foreach ($this->fonts as $fk => $font) {
9951 if (isset($font['type']) && $font['type'] == 'TTF' && !$font['used']) {
9952 if ($font['sip'] || $font['smp']) {
9953 foreach ($font['subsetfontids'] as $k => $fid) {
9960 $this->pages[$pn] = preg_replace('/\s\/F' . $font['i'] . ' \d[\d.]* Tf\s/is', ' ', $this->pages[$pn]);
10667 function Shaded_box($text, $font = '', $fontstyle = 'B', $szfont = '', $width = '70%', $style = 'DF', $radius = 2.5, $fill = '#FFFFFF', $color = '#000000', $pad = 2)
10673 $this->directWrite->Shaded_box($text, $font, $fontstyle, $szfont, $width, $style, $radius, $fill, $color, $pad);
10805 // Add Big5 font with proportional Latin
10828 // Add GB font with proportional Latin
10852 // Add SJIS font with proportional Latin
10876 // Add UHC font with proportional Latin
10908 function SetDefaultFont($font)
10912 if (strtolower($font) == 'ctimes') {
10913 $font = 'serif';
10915 if (strtolower($font) == 'ccourier') {
10916 $font = 'monospace';
10918 if (strtolower($font) == 'chelvetica') {
10919 $font = 'sans-serif';
10922 $font = $this->SetFont($font); // returns substituted font if necessary
10923 $this->default_font = $font;
10924 $this->original_default_font = $font;
10926 $this->watermark_font = $font;
10928 $this->defaultCSS['BODY']['FONT-FAMILY'] = $font;
10929 $this->cssManager->CSS['BODY']['FONT-FAMILY'] = $font;
11049 // Fontsize uses font metrics - this method seems to produce results compatible with browsers (except IE9)
11085 // If an inline element has a font-size less than the block element, and the line-height is set as an em or % value
11086 // it will add too much leading below the font and expand the height of the line - so just use the block element exttop/extbottom:
11115 function _setInlineBlockHeights(&$lineBox, &$stackHeight, &$content, &$font, $is_table)
11149 // First, set a "strut" using block font at index $lineBox[-1]
11187 $fontsize = $font[$k]['size'];
11188 $fontdesc = $font[$k]['curr']['desc'];
11227 $fontsize = $font[$k]['size'];
11228 $fontdesc = $font[$k]['curr']['desc'];
11232 if (isset($font[$k]['textparam']['text-baseline']) && $font[$k]['textparam']['text-baseline'] != 0) {
11233 $ypos[$k]['baseline-shift'] = $font[$k]['textparam']['text-baseline'];
11275 if (isset($font[$k]['bord']) && $font[$k]['bord']) {
11276 $bordfontsize = $font[$k]['textparam']['bord-decoration']['fontsize'] / $shrin_k;
11277 $bordfontkey = $font[$k]['textparam']['bord-decoration']['fontkey'];
11278 if ($bordfontkey != $fontkey || $bordfontsize != $fontsize || isset($font[$k]['textparam']['bord-decoration']['baseline'])) {
11281 if (isset($font[$k]['textparam']['bord-decoration']['baseline']) && $font[$k]['textparam']['bord-decoration']['baseline'] != 0) {
11282 $bordypos[$k]['baseline-shift'] = $font[$k]['textparam']['bord-decoration']['baseline'] / $shrin_k;
11287 if (isset($font[$k]['spanbgcolor']) && $font[$k]['spanbgcolor']) {
11288 $bgfontsize = $font[$k]['textparam']['bg-decoration']['fontsize'] / $shrin_k;
11289 $bgfontkey = $font[$k]['textparam']['bg-decoration']['fontkey'];
11290 if ($bgfontkey != $fontkey || $bgfontsize != $fontsize || isset($font[$k]['textparam']['bg-decoration']['baseline'])) {
11293 if (isset($font[$k]['textparam']['bg-decoration']['baseline']) && $font[$k]['textparam']['bg-decoration']['baseline'] != 0) {
11294 $bgypos[$k]['baseline-shift'] = $font[$k]['textparam']['bg-decoration']['baseline'] / $shrin_k;
11362 $oh = $font[$k]['size']; // == $this->objectbuffer[$k]['fontsize']/Mpdf::SCALE;
11631 $checkfont = true; // Using list - font is set, so check if character is available
11634 $checkfont = false; // For pagenumbers - font is not set, so no check
12561 if (isset($arr['L']['font-family'])) {
12562 $html .= ' font-family: ' . $arr['L']['font-family'] . ';';
12569 if (isset($arr['L']['font-size'])) {
12570 $html .= ' font-size: ' . $arr['L']['font-size'] . 'pt;';
12573 if (isset($arr['L']['font-style'])) {
12574 if ($arr['L']['font-style'] == 'B' || $arr['L']['font-style'] == 'BI') {
12575 $html .= ' font-weight: bold;';
12577 if ($arr['L']['font-style'] == 'I' || $arr['L']['font-style'] == 'BI') {
12578 $html .= ' font-style: italic;';
12585 if (isset($arr['C']['font-family'])) {
12586 $html .= ' font-family: ' . $arr['C']['font-family'] . ';';
12593 if (isset($arr['C']['font-size'])) {
12594 $html .= ' font-size: ' . $arr['C']['font-size'] . 'pt;';
12597 if (isset($arr['C']['font-style'])) {
12598 if ($arr['C']['font-style'] == 'B' || $arr['C']['font-style'] == 'BI') {
12599 $html .= ' font-weight: bold;';
12601 if ($arr['C']['font-style'] == 'I' || $arr['C']['font-style'] == 'BI') {
12602 $html .= ' font-style: italic;';
12609 if (isset($arr['R']['font-family'])) {
12610 $html .= ' font-family: ' . $arr['R']['font-family'] . ';';
12617 if (isset($arr['R']['font-size'])) {
12618 $html .= ' font-size: ' . $arr['R']['font-size'] . 'pt;';
12621 if (isset($arr['R']['font-style'])) {
12622 if ($arr['R']['font-style'] == 'B' || $arr['R']['font-style'] == 'BI') {
12623 $html .= ' font-weight: bold;';
12625 if ($arr['R']['font-style'] == 'I' || $arr['R']['font-style'] == 'BI') {
12626 $html .= ' font-style: italic;';
12730 $oddhtml .= ' font-size: ' . $this->defaultheaderfontsize . 'pt;';
12736 $oddhtml .= ' font-weight: bold;';
12740 $oddhtml .= ' font-style: italic;';
12758 $evenhtml .= ' font-size: ' . $this->defaultheaderfontsize . 'pt;';
12763 $evenhtml .= ' font-weight: bold;';
12766 $evenhtml .= ' font-style: italic;';
12786 $oddhtml .= ' font-size: ' . $this->defaultheaderfontsize . 'pt;';
12792 $oddhtml .= ' font-weight: bold;';
12796 $oddhtml .= ' font-style: italic;';
12808 $evenhtml .= ' font-size: ' . $this->defaultheaderfontsize . 'pt;';
12814 $evenhtml .= ' font-weight: bold;';
12818 $evenhtml .= ' font-style: italic;';
12875 $oddhtml .= ' font-size: ' . $this->defaultfooterfontsize . 'pt;';
12880 $oddhtml .= ' font-weight: bold;';
12883 $oddhtml .= ' font-style: italic;';
12901 $evenhtml .= ' font-size: ' . $this->defaultfooterfontsize . 'pt;';
12907 $evenhtml .= ' font-weight: bold;';
12911 $evenhtml .= ' font-style: italic;';
12931 $oddhtml .= ' font-size: ' . $this->defaultfooterfontsize . 'pt;';
12937 $oddhtml .= ' font-weight: bold;';
12941 $oddhtml .= ' font-style: italic;';
12954 $evenhtml .= ' font-size: ' . $this->defaultfooterfontsize . 'pt;';
12960 $evenhtml .= ' font-weight: bold;';
12964 $evenhtml .= ' font-style: italic;';
13448 // If core font is selected in document which is not onlyCoreFonts - substitute with non-core font
13960 // font*[family/size/style/weight]/line-height/text*[align/decoration/transform/indent]/color are transferred to $inner
14021 $css .= 'font-family: ' . strtolower($p['FONT-FAMILY']) . '; ';
14024 $css .= 'font-style: ' . strtolower($p['FONT-STYLE']) . '; ';
14027 $css .= 'font-weight: ' . strtolower($p['FONT-WEIGHT']) . '; ';
14030 $css .= 'font-size: ' . strtolower($p['FONT-SIZE']) . '; ';
14043 $css .= 'font-variant-position: ' . strtolower($p['FONT-VARIANT-POSITION']) . '; ';
14046 $css .= 'font-variant-caps: ' . strtolower($p['FONT-VARIANT-CAPS']) . '; ';
14049 $css .= 'font-variant-ligatures: ' . strtolower($p['FONT-VARIANT-LIGATURES']) . '; ';
14052 $css .= 'font-variant-numeric: ' . strtolower($p['FONT-VARIANT-NUMERIC']) . '; ';
14055 $css .= 'font-variant-alternates: ' . strtolower($p['FONT-VARIANT-ALTERNATES']) . '; ';
14058 $css .= 'font-feature-settings: ' . strtolower($p['FONT-FEATURE-SETTINGS']) . '; ';
14061 $css .= 'font-language-override: ' . strtolower($p['FONT-LANGUAGE-OVERRIDE']) . '; ';
14064 $css .= 'font-kerning: ' . strtolower($p['FONT-KERNING']) . '; ';
15465 } elseif ($listitemtype == 'disc' || $listitemtype == 'circle' || $listitemtype == 'square') { // SYMBOL (needs new font)
15492 } elseif (preg_match('/U\+([a-fA-F0-9]+)/i', $listitemtype, $m)) { // SYMBOL 2 (needs new font)
15941 // As a failsafe - if font has been set but not output to page
16118 $font = $this->SetFont($vetor[4], $this->FontStyle, 0, false);
16802 // Set font, size, style, color
18132 // Set font size first so that e.g. MARGIN 0.83em works on font size for this element
18175 // If it is a font list, get all font types
18891 case 'COLOR': // font color
19041 $this->enabledtags = "<a><acronym><address><article><aside><b><bdi><bdo><big><blockquote><br><caption><center><cite><code><del><details><dd><div><dl><dt><em><fieldset><figcaption><figure><font><form><h1><h2><h3><h4><h5><h6><hgroup><hr><i><img><input><ins><kbd><legend><li><main><mark><meter><nav><ol><option><p><pre><progress><q><s><samp><section><select><small><span><strike><strong><sub><summary><sup><table><tbody><td><template><textarea><tfoot><th><thead><time><tr><tt><u><ul><var><footer><header><annotation><bookmark><textcircle><barcode><dottab><indexentry><indexinsert><watermarktext><watermarkimage><tts><ttz><tta><column_break><columnbreak><newcolumn><newpage><page_break><pagebreak><formfeed><columns><toc><tocentry><tocpagebreak><pageheader><pagefooter><setpageheader><setpagefooter><sethtmlpageheader><sethtmlpagefooter>";
19103 $font = $this->SetFont($chunk[4], $this->FontStyle, 0, false);
25361 function AutosizeText($text, $w, $font, $style, $szfont = 72)
25366 $this->SetFont($font, $style, $szfont, false);
25410 $this->SetFont($font, $style, $szfont, false);
25420 $this->SetFont($font, $style, $szfont, true, true);
25575 $font = $this->CurrentFont['sipext'];
25576 if (!in_array($font, $this->available_unifonts)) {
25580 array_splice($writehtml_a, $writehtml_i + 1, 0, ['span style="font-family: ' . $font . '"', $m[2], '/span', $m[3]]);
25590 * If core font is selected in document which is not onlyCoreFonts - substitute with non-core font
25642 // Try in backup subs font
25653 $font = $bsf;
25657 if (isset($this->fonts[$font])) {
25658 $cw = &$this->fonts[$font]['cw'];
25659 } elseif ($this->fontCache->has($font . '.cw.dat')) {
25660 $cw = $this->fontCache->load($font . '.cw.dat');
25678 if ($l == 0 && $bsfctr == (count($this->backupSubsFont) - 1)) { // Not found even in last backup font
25695 array_splice($writehtml_a, $writehtml_i + 1, 0, ['span style="font-family: ' . $font . '"', $m[2], '/span', $m[3]]);
25767 // Check if current CJK font has a ext-B related font
25769 $font = $this->CurrentFont['sipext'];
25773 if (isset($this->fonts[$font])) {
25774 $cw = &$this->fonts[$font]['cw'];
25775 } elseif ($this->fontCache->has($font . '.cw.dat')) {
25776 $cw = $this->fontCache->load($font . '.cw.dat');
25781 $this->SetFont($font, '', '', false);
25802 array_splice($writehtml_a, $writehtml_i + 1, 0, ['span style="font-family: ' . $font . '"', $m[2], '/span', $m[3]]);
25809 // Check Backup SIP font (defined in Config\FontVariables)
25813 $font = $this->backupSIPFont;
25822 if (isset($this->fonts[$font])) {
25823 $cw = &$this->fonts[$font]['cw'];
25824 } elseif ($this->fontCache->has($font . '.cw.dat')) {
25825 $cw = $this->fontCache->load($font . '.cw.dat');
25851 array_splice($writehtml_a, $writehtml_i + 1, 0, ['span style="font-family: ' . $font . '"', $m[2], '/span', $m[3]]);
25871 $font = 'tta';
25881 $font = 'ttz';
25891 $font = 'tts';
25905 array_splice($writehtml_a, $writehtml_i + 1, 0, [$font, implode('|', $repl), '/' . $font, $m[3]]); // e.g. <tts>
25920 $font = $bsf;
25928 if (isset($this->fonts[$font])) {
25929 $cw = &$this->fonts[$font]['cw'];
25930 } elseif ($this->fontCache->has($font . '.cw.dat')) {
25931 $cw = $this->fontCache->load($font . '.cw.dat');
25938 if ($this->fontCache->has($font . '.cw.dat')) {
25939 $cw = $this->fontCache->load($font . '.cw.dat');
25952 if ($l == 0 && $bsfctr == (count($this->backupSubsFont) - 1)) { // Not found even in last backup font
25968 array_splice($writehtml_a, $writehtml_i + 1, 0, ['span style="font-family: ' . $font . '"', $m[2], '/span', $m[3]]);
26269 $this->SetFont('', '', $codestr_fontsize * 1.4 * Mpdf::SCALE, true, true); // * 1.4 because font height is only 7/10 of given mm