Movatterモバイル変換


[0]ホーム

URL:


mPDF Manual – Fonts & Languages

Character substitution

(mPDF ≥ 5.0)

Note: Prior to mPDF 5.0 there were 2 configurable variables,$this->useSubstitutions and$this->useSubstitutionsMB. controlling behaviour of core fonts and unicode fonts respectively. From mPDF 5.0, character substitution using core fonts is always ON and cannot be disabled by configurable variables.

$this->useSubstitutionsMB is deprecated but it is recognised as an alias for$this->useSubstitutions.$this->useSubstitutions controls behaviour in Unicode font documents.

Core fonts

In documents using core fonts only, only characters included in thewin-1252 codepage are availablein the Arial/Helvetica, Times or Courier fonts. If the document includes characters which are included in the other coreAdobe fonts -Symbols, or Dingbats - thesewill be substituted. Because they are displayed using a different font they may appear ‘odd’.

Unicode fonts

In Unicode Truetype files, the limitation is whether the font file contains a “glyph” for each character in the document.Character substitution (i.e. substituting a different font solely to display that character) can be enabled by settingtheuseSubstitutionconfiguration variable.

<?php$this->useSubstitutions=true;

mPDF will try to find substitutions for any missing characters:

  1. if the character is in Unicode Plane 2 (SIP) i.e. Unicode value > U+20000:
    1. looks in the sip-ext font file(seeFonts in mPDF 5.x)
    2. looks in the font defined bybackupSIPFontconfiguration variable
  2. looks to see if the character is available in the core fonts: Arial/Helvetica, Times, Courier, Symbols or ZapfDingbats
  3. looks in each of the the font(s) set bybackupSubsFontconfiguration variables

It is not recommended to enable this for regular use, as it will add to the processing time.


[8]ページ先頭

©2009-2026 Movatter.jp