/**
* Returns the length of the char in user unit for the current font considering current stretching and spacing (tracking).
* @param $char (int) The char code whose length is to be returned
* @param $notlast (boolean) If false ignore the font-spacing.
* @return float char width
* @author Nicola Asuni
* @public
* @since 2.4.000 (2008-03-06)
*/
public function GetCharWidth($char, $notlast=true) {
// get raw width
$chw = $this->getRawCharWidth($char);
if (($this->font_spacing < 0) OR (($this->font_spacing > 0) AND $notlast)) {
// increase/decrease font spacing
$chw += $this->font_spacing;
}
if ($this->font_stretching != 100) {
// fixed stretching mode
$chw *= ($this->font_stretching / 100);
}
// ↓を追加
if (in_array($char, array(65377, 65378, 65379, 65380, 65381, 65382, 65383, 65384, 65385, 65386, 65387, 65388, 65389, 65390, 65391, 65392, 65393, 65394, 65395, 65396, 65397, 65398, 65399, 65400,65401, 65402, 65403, 65404, 65405, 65406, 65407, 65408, 65409, 65410, 65411, 65412, 65413, 65414, 65415, 65416, 65417, 65418, 65419, 65420, 65421, 65422, 65423, 65424, 65425, 65426, 65427, 65428, 65429, 65430, 65431, 65432, 65433, 65434, 65435, 65436, 65437, 65438))) {
$chw /= 2.0; //半角カタカナの幅を半分に
}
// ↑まで
return $chw;
}