Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Fonts rendering differently between macOS and Ubuntu #113

Open
mudge opened this issue Mar 16, 2023 · 0 comments
Open

Fonts rendering differently between macOS and Ubuntu #113

mudge opened this issue Mar 16, 2023 · 0 comments

Comments

@mudge
Copy link

mudge commented Mar 16, 2023

Given the following test script:

require 'mathematical'

renderer = Mathematical.new(format: :png, ppi: 300.0)
File.write('test.png', renderer.render('$x$').fetch(:data))

Running it on macOS 13.2.1 with 1.6.14 produces the following image:

test

Running it on Ubuntu 22.04, Ubuntu 20.04 and Ubuntu 18.04 with 1.6.14 produces the following image:

test

I tested macOS by installing the dependencies with Homebrew and installing the required fonts as detailed in the README:

brew install glib gdk-pixbuf cairo pango cmake

I tested Ubuntu using the ubuntu:22.04, ubuntu:20.04 and ubuntu:18.04 Docker images and installing the necessary dependencies with the following:

apt update
apt install -qq -y ruby ruby-dev bison flex libffi-dev libxml2-dev libgdk-pixbuf2.0-dev libcairo2-dev libpango1.0-dev fonts-lyx cmake g++ libwebp-dev libzstd-dev
gem install mathematical --no-document

I can confirm the LyX fonts are installed with:

# fc-list | grep lyx
/usr/share/fonts/truetype/lyx/msbm10.ttf: msbm10:style=LyX
/usr/share/fonts/truetype/lyx/cmr10.ttf: cmr10:style=LyX
/usr/share/fonts/truetype/lyx/eufm10.ttf: eufm10:style=LyX
/usr/share/fonts/truetype/lyx/rsfs10.ttf: rsfs10:style=LyX
/usr/share/fonts/truetype/lyx/cmex10.ttf: cmex10:style=LyX
/usr/share/fonts/truetype/lyx/cmmi10.ttf: cmmi10:style=LyX
/usr/share/fonts/truetype/lyx/cmsy10.ttf: cmsy10:style=LyX
/usr/share/fonts/truetype/lyx/msam10.ttf: msam10:style=LyX
/usr/share/fonts/truetype/lyx/wasy10.ttf: wasy10:style=LyX
/usr/share/fonts/truetype/lyx/esint10.ttf: esint10:style=LyX
/usr/share/fonts/truetype/lyx/stmary10.ttf: stmary10:style=LyX

I also tried compiling the gem on Ubuntu from source but it still produced the same output.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants