mathematical 1.6.20 → 1.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/fonts/cmex10.ttf ADDED
Binary file
data/fonts/cmmi10.ttf ADDED
Binary file
data/fonts/cmr10.ttf ADDED
Binary file
data/fonts/cmsy10.ttf ADDED
Binary file
data/fonts/eufm10.ttf ADDED
Binary file
data/fonts/fonts.conf ADDED
@@ -0,0 +1,11 @@
1
+ <?xml version="1.0"?>
2
+ <!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd">
3
+ <!--
4
+ Fontconfig configuration for bundled Computer Modern fonts.
5
+ This file is loaded via FONTCONFIG_PATH at runtime so that
6
+ lasem can find the math fonts for SVG/PNG rendering.
7
+ -->
8
+ <fontconfig>
9
+ <dir prefix="relative">.</dir>
10
+ <cachedir prefix="xdg">fontconfig</cachedir>
11
+ </fontconfig>
data/fonts/msam10.ttf ADDED
Binary file
data/fonts/msbm10.ttf ADDED
Binary file
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class Mathematical
4
- VERSION = "1.6.20"
4
+ VERSION = "1.7.0"
5
5
  end
data/lib/mathematical.rb CHANGED
@@ -1,6 +1,13 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "mathematical/mathematical"
3
+ # Load the precompiled native extension (version-specific) or fall back
4
+ # to the source-compiled extension.
5
+ begin
6
+ RUBY_VERSION =~ /(\d+\.\d+)/
7
+ require "mathematical/#{Regexp.last_match(1)}/mathematical"
8
+ rescue LoadError
9
+ require "mathematical/mathematical"
10
+ end
4
11
 
5
12
  require "mathematical/configuration"
6
13
  require "mathematical/corrections"
@@ -10,6 +17,14 @@ require "mathematical/version"
10
17
  require "base64"
11
18
 
12
19
  class Mathematical
20
+ # Set up bundled fonts for fontconfig (used by lasem for SVG/PNG rendering).
21
+ # This allows SVG/PNG rendering without system font installation.
22
+ FONT_DIR = File.expand_path("../../fonts", __dir__)
23
+ if File.directory?(FONT_DIR)
24
+ existing = ENV.fetch("FONTCONFIG_PATH", "")
25
+ ENV["FONTCONFIG_PATH"] = existing.empty? ? FONT_DIR : "#{FONT_DIR}:#{existing}"
26
+ end
27
+
13
28
  include Corrections
14
29
  include Validator
15
30
 
data/mathematical.gemspec CHANGED
@@ -15,16 +15,20 @@ Gem::Specification.new do |spec|
15
15
  spec.homepage = "https://github.com/gjtorikian/mathematical"
16
16
  spec.license = "MIT"
17
17
 
18
+ spec.required_ruby_version = ">= 3.1"
19
+
18
20
  spec.files = ["LICENSE.txt", "README.md", "Rakefile", "mathematical.gemspec"]
19
21
  spec.files += Dir.glob("lib/**/*.rb")
20
22
  spec.files += Dir["ext/**/*"].reject { |f| f =~ /\.svg$|\.mml$|\.png$|\.o$/ }
21
- spec.require_paths = ["lib", "ext"]
23
+ spec.files += Dir.glob("fonts/**/*")
24
+ spec.require_paths = ["lib"]
22
25
  spec.extensions = ["ext/mathematical/extconf.rb"]
23
26
 
24
27
  spec.add_dependency("ruby-enum", ">= 0.4", "< 2.0")
25
28
 
29
+ spec.add_development_dependency("benchmark")
26
30
  spec.add_development_dependency("math-to-itex", "~> 0.3")
27
31
  spec.add_development_dependency("minitest", "~> 5.6")
28
32
  spec.add_development_dependency("nokogiri", "~> 1.10")
29
- spec.add_development_dependency("rake-compiler", "~> 1.0")
33
+ spec.add_development_dependency("rake-compiler", "~> 1.2")
30
34
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mathematical
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.20
4
+ version: 1.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Garen Torikian
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-08-14 00:00:00.000000000 Z
11
+ date: 2026-04-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ruby-enum
@@ -30,6 +30,20 @@ dependencies:
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
32
  version: '2.0'
33
+ - !ruby/object:Gem::Dependency
34
+ name: benchmark
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - ">="
38
+ - !ruby/object:Gem::Version
39
+ version: '0'
40
+ type: :development
41
+ prerelease: false
42
+ version_requirements: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: '0'
33
47
  - !ruby/object:Gem::Dependency
34
48
  name: math-to-itex
35
49
  requirement: !ruby/object:Gem::Requirement
@@ -78,14 +92,14 @@ dependencies:
78
92
  requirements:
79
93
  - - "~>"
80
94
  - !ruby/object:Gem::Version
81
- version: '1.0'
95
+ version: '1.2'
82
96
  type: :development
83
97
  prerelease: false
84
98
  version_requirements: !ruby/object:Gem::Requirement
85
99
  requirements:
86
100
  - - "~>"
87
101
  - !ruby/object:Gem::Version
88
- version: '1.0'
102
+ version: '1.2'
89
103
  description: A very fast way to turn TeX math equations into beautifully rendered
90
104
  SVGs, to embed on the web. This library is mostly written in C and is a general
91
105
  purpose wrapper to GNOME's Lasem.
@@ -525,17 +539,18 @@ files:
525
539
  - ext/mathematical/mtex2MML/CONTRIBUTING.md
526
540
  - ext/mathematical/mtex2MML/README.md
527
541
  - ext/mathematical/mtex2MML/SUPPORTED.md
528
- - ext/mathematical/mtex2MML/appveyor.yml
529
542
  - ext/mathematical/mtex2MML/cmake/Modules/astyle.cmake
530
543
  - ext/mathematical/mtex2MML/deps/uthash/package.json
531
544
  - ext/mathematical/mtex2MML/deps/uthash/utarray.h
532
545
  - ext/mathematical/mtex2MML/deps/uthash/uthash.h
533
546
  - ext/mathematical/mtex2MML/deps/uthash/utlist.h
534
547
  - ext/mathematical/mtex2MML/deps/uthash/utringbuffer.h
548
+ - ext/mathematical/mtex2MML/deps/uthash/utstack.h
535
549
  - ext/mathematical/mtex2MML/deps/uthash/utstring.h
536
550
  - ext/mathematical/mtex2MML/script/bootstrap
537
551
  - ext/mathematical/mtex2MML/script/cibuild
538
552
  - ext/mathematical/mtex2MML/script/tag
553
+ - ext/mathematical/mtex2MML/script/test-quick
539
554
  - ext/mathematical/mtex2MML/src/colors.c
540
555
  - ext/mathematical/mtex2MML/src/colors.h
541
556
  - ext/mathematical/mtex2MML/src/em.c
@@ -1288,6 +1303,15 @@ files:
1288
1303
  - ext/mathematical/mtex2MML/tests/numbered_equations.c
1289
1304
  - ext/mathematical/mtex2MML/tests/performance.c
1290
1305
  - ext/mathematical/mtex2MML/tests/symbols.c
1306
+ - ext/pulldown-latex/Cargo.lock
1307
+ - fonts/cmex10.ttf
1308
+ - fonts/cmmi10.ttf
1309
+ - fonts/cmr10.ttf
1310
+ - fonts/cmsy10.ttf
1311
+ - fonts/eufm10.ttf
1312
+ - fonts/fonts.conf
1313
+ - fonts/msam10.ttf
1314
+ - fonts/msbm10.ttf
1291
1315
  - lib/mathematical.rb
1292
1316
  - lib/mathematical/configuration.rb
1293
1317
  - lib/mathematical/corrections.rb
@@ -1298,24 +1322,23 @@ homepage: https://github.com/gjtorikian/mathematical
1298
1322
  licenses:
1299
1323
  - MIT
1300
1324
  metadata: {}
1301
- post_install_message:
1325
+ post_install_message:
1302
1326
  rdoc_options: []
1303
1327
  require_paths:
1304
1328
  - lib
1305
- - ext
1306
1329
  required_ruby_version: !ruby/object:Gem::Requirement
1307
1330
  requirements:
1308
1331
  - - ">="
1309
1332
  - !ruby/object:Gem::Version
1310
- version: '0'
1333
+ version: '3.1'
1311
1334
  required_rubygems_version: !ruby/object:Gem::Requirement
1312
1335
  requirements:
1313
1336
  - - ">="
1314
1337
  - !ruby/object:Gem::Version
1315
1338
  version: '0'
1316
1339
  requirements: []
1317
- rubygems_version: 3.3.7
1318
- signing_key:
1340
+ rubygems_version: 3.5.22
1341
+ signing_key:
1319
1342
  specification_version: 4
1320
1343
  summary: Quickly convert math equations into beautiful SVGs/PNGs/MathML.
1321
1344
  test_files: []
@@ -1,35 +0,0 @@
1
- version: '{build}'
2
- branches:
3
- only:
4
- - master
5
- clone_depth: 10
6
- cache:
7
- - win_flex_bison-2.4.5.zip
8
- matrix:
9
- fast_finish: true
10
- environment:
11
- WINFLEXBISON_ARCHIVE: win_flex_bison-2.4.5.zip
12
- PYTHON: "C:\\Python34-x64"
13
- PYTHON_VERSION: "3.4.3"
14
- PYTHON_ARCH: "64"
15
- matrix:
16
- - GENERATOR: "Visual Studio 13"
17
- ARCH: 32
18
- - GENERATOR: "Visual Studio 13"
19
- ARCH: 64
20
- install:
21
- # Install flex/bison
22
- - if not exist "%WINFLEXBISON_ARCHIVE%" appveyor DownloadFile "http://downloads.sourceforge.net/project/winflexbison/%WINFLEXBISON_ARCHIVE%"
23
- - 7z x -y -owinflexbison\ "%WINFLEXBISON_ARCHIVE%" > nul
24
- - set Path=%CD%\winflexbison;%Path%
25
- - win_flex --version
26
- - win_bison --version
27
- build_script:
28
- - ps: |
29
- mkdir build
30
- cmake . -Bbuild -G "Visual Studio 12 2013"
31
- msbuild /p:Configuration=Release build/mtex2MML.sln
32
- test_script:
33
- - ps: |
34
- cd build
35
- ctest -V