-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #67 from Kolaru/full_unicode_font
Good support for NewComputerModern font
- Loading branch information
Showing
13 changed files
with
169 additions
and
115 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,8 +15,8 @@ jobs: | |
fail-fast: false | ||
matrix: | ||
version: | ||
- '1.7' | ||
- '1.6' | ||
- '1.3' | ||
os: | ||
- ubuntu-latest | ||
arch: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
name = "MathTeXEngine" | ||
uuid = "0a4f8689-d25c-4efe-a92b-7142dfc1aa53" | ||
authors = ["Benoît Richard <[email protected]>"] | ||
version = "0.4.3" | ||
version = "0.5.0" | ||
|
||
[deps] | ||
AbstractTrees = "1520ce14-60c1-5f80-bbc7-55ef81b5835c" | ||
|
@@ -18,8 +18,8 @@ Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" | |
AbstractTrees = "0.3, 0.4" | ||
Automa = "0.8" | ||
DataStructures = "0.18" | ||
FreeTypeAbstraction = "0.9" | ||
FreeTypeAbstraction = "0.10" | ||
GeometryBasics = "0.4.1, 0.4.2" | ||
LaTeXStrings = "1.2" | ||
RelocatableFolders = "0.1, 0.2, 0.3" | ||
julia = "1.3" | ||
julia = "1.6" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
using Pkg | ||
|
||
Pkg.activate("prototype") | ||
|
||
using MathTeXEngine | ||
using CairoMakie | ||
|
||
tex = L"\int dx \theta 2 x" | ||
text(0, 0 ; text = tex, textsize=20) | ||
|
||
|
||
elems = generate_tex_elements(tex) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
_latex_to_new_computer_modern = Dict( | ||
raw"\int" => 5930, | ||
raw"\sum" => 5941, | ||
|
||
raw"\partial" => 3377, | ||
raw"\varepsilon" => 3378, | ||
raw"\vartheta" => 3379, | ||
raw"\varkappa" => 3380, | ||
raw"\varphi" => 3381, | ||
raw"\varrho" => 3382, | ||
raw"\varpi" => 3383, | ||
|
||
raw"\epsilon" => 3356, | ||
raw"\theta" => 3359, | ||
raw"\kappa" => 3361, | ||
raw"\phi" => 3373, | ||
raw"\rho" => 3368, | ||
raw"\pi" => 3367 | ||
) | ||
|
||
|
||
_symbol_to_new_computer_modern = Dict{Char, Tuple{String, Int}}() | ||
cmmath_fontpath = joinpath("NewComputerModern", "NewCMMath-Regular.otf") | ||
|
||
for (symbol, glyph_id) in _latex_to_new_computer_modern | ||
if haskey(latex_symbols, symbol) | ||
symbol = latex_symbols[symbol][1] | ||
else | ||
symbol = symbol[1] | ||
end | ||
|
||
_symbol_to_new_computer_modern[symbol] = (cmmath_fontpath, glyph_id) | ||
end | ||
|
||
# Standard hreek symbols : thin and italic | ||
for i in 0:24 | ||
capital = 'Α' + i | ||
small = 'α' + i | ||
|
||
if !haskey(_symbol_to_new_computer_modern, capital) | ||
_symbol_to_new_computer_modern[capital] = (cmmath_fontpath, 3326 + i) | ||
end | ||
if !haskey(_symbol_to_new_computer_modern, small) | ||
_symbol_to_new_computer_modern[small] = (cmmath_fontpath, 3352 + i) | ||
end | ||
end |
Oops, something went wrong.
c757b00
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't you want to register this? :)
c757b00
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jkrumbiegel I would very much like to, but Registrator (through JuliaHub -- which I use normally) don't let me :(
I have been told that the problem should be resolved very soon.
c757b00
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, you could try JuliaRegistrator, it's what we use for Makie too
c757b00
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JuliaRegistrator register
c757b00
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Registration pull request created: JuliaRegistries/General/65062
After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.
This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via: