Skip to content

Commit

Permalink
fix unicode symbols
Browse files Browse the repository at this point in the history
The phpmathpublisher update in 7823a7f
changed which fonts are used to render texts. This broke the display of
some unicode symbols like Ω.

This reverts to the use of the FreeSerif and FreeSerifItalic fonts.
  • Loading branch information
splitbrain committed May 23, 2024
1 parent e4a09c3 commit 01f4019
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion deleted.files
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@ phpmathpublisher/CHANGELOG
phpmathpublisher/COPYING
phpmathpublisher/expression_math.php
phpmathpublisher/expression_texte.php
phpmathpublisher/fonts/FreeSerifItalic.ttf
phpmathpublisher/mathpublisher.php
4 changes: 2 additions & 2 deletions phpmathpublisher/Helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -743,9 +743,9 @@ public function displayMath($text, $size)
if (isset($fontsMath[$text])) {
$font = $dirFonts . "/" . $fontsMath[$text] . ".ttf";
} elseif (preg_match("#[a-zA-Z]#", $text)) {
$font = $dirFonts . "/cmmi10.ttf";
$font = $dirFonts . "/FreeSerifItalic.ttf";
} else {
$font = $dirFonts . "/cmr10.ttf";
$font = $dirFonts . "/FreeSerif.ttf";
}
if (isset($symbols[$text])) {
$text = $symbols[$text];
Expand Down
Binary file added phpmathpublisher/fonts/FreeSerifItalic.ttf
Binary file not shown.

0 comments on commit 01f4019

Please sign in to comment.