Skip to content

Conversation

@Kolaru
Copy link
Owner

@Kolaru Kolaru commented Jun 7, 2025

This PR introduces the set_texfont_family function, that can be used to more easily change the default font used by the engine:

# Change to a different font familiy entirely
julia> set_texfont_family!(FontFamily("LucioleMath"))
FontFamily with 13.0° slant angle and 0.0375 line thickness
  bold        =>  Luciole-Math\Luciole-Bold.ttf
  bolditalic  =>  Luciole-Math\Luciole-Bold-Italic.ttf
  italic      =>  Luciole-Math\Luciole-Regular-Italic.ttf
  math        =>  Luciole-Math\Luciole-Math.otf
  regular     =>  Luciole-Math\Luciole-Regular.ttf

# Change just the regular and bold fonts, keep the default for the rest
julia> set_texfont_family!(regular = raw"C:\Users\Kolaru\.julia\dev\MathTeXEngine\experimental\utopia\Utopia-Regular.ttf", bold = raw"C:\Users\Kolaru\.julia\dev\MathTeXEngine\experimental\utopia\Utopia-Bold.ttf")
FontFamily with 13.0° slant angle and 0.0375 line thickness
  bold        =>  C:\Users\Kolaru\.julia\dev\MathTeXEngine\experimental\utopia\Utopia-Bold.ttf
  bolditalic  =>  NewComputerModern\NewCM10-BoldItalic.otf
  italic      =>  NewComputerModern\NewCM10-Italic.otf
  math        =>  NewComputerModern\NewCMMath-Regular.otf
  regular     =>  C:\Users\Kolaru\.julia\dev\MathTeXEngine\experimental\utopia\Utopia-Regular.ttf

# Switch back to the default
julia> set_texfont_family!()
FontFamily with 13.0° slant angle and 0.0375 line thickness
  bold        =>  NewComputerModern\NewCM10-Bold.otf
  bolditalic  =>  NewComputerModern\NewCM10-BoldItalic.otf
  italic      =>  NewComputerModern\NewCM10-Italic.otf
  math        =>  NewComputerModern\NewCMMath-Regular.otf
  regular     =>  NewComputerModern\NewCMMath-Regular.otf

@Kolaru Kolaru merged commit 2b777f5 into master Jun 13, 2025
4 checks passed
@tduretz
Copy link

tduretz commented Oct 4, 2025

Hi there,
Would this PR allow to print latex strings that feature both straight and italic font greek characters?
(see that post)
For the time being this MWE only produces italic font greek characters.

f = Figure()
Axis(f[1, 1], title=L"$\theta$ θ \mathrm{θ} \mathbf{θ} \text{\theta} \textrm{\theta}" )
display(f)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants