How to write square meter symbol in FPDF?

I need to output square meter symbol in FPDF. The font is Shift JIS.

//... rest omitted

$this->label_cell[] = '合計m²数';

//... rest omitted

But the rendered is result is 合計m?数. I believe ² is a unicode character(U+00B2). But why is it garbled? How do I render square meter symbol correctly?

1 answer

  • answered 2019-11-11 04:51 bravemaster

    I just used symbol instead. It worked. is a single symbol U+33A1 but is letter m with superscript 2. If you're interested in rendering superscripts in FPDF please refer to this link.