mathematical 1.6.18 → 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.18"
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
- spec.add_dependency("ruby-enum", "~> 0.4")
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,30 +1,49 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mathematical
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.18
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: 2023-11-30 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
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0.4'
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: '2.0'
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
24
- - - "~>"
27
+ - - ">="
25
28
  - !ruby/object:Gem::Version
26
29
  version: '0.4'
27
- force_ruby_platform: false
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
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'
28
47
  - !ruby/object:Gem::Dependency
29
48
  name: math-to-itex
30
49
  requirement: !ruby/object:Gem::Requirement
@@ -73,14 +92,14 @@ dependencies:
73
92
  requirements:
74
93
  - - "~>"
75
94
  - !ruby/object:Gem::Version
76
- version: '1.0'
95
+ version: '1.2'
77
96
  type: :development
78
97
  prerelease: false
79
98
  version_requirements: !ruby/object:Gem::Requirement
80
99
  requirements:
81
100
  - - "~>"
82
101
  - !ruby/object:Gem::Version
83
- version: '1.0'
102
+ version: '1.2'
84
103
  description: A very fast way to turn TeX math equations into beautifully rendered
85
104
  SVGs, to embed on the web. This library is mostly written in C and is a general
86
105
  purpose wrapper to GNOME's Lasem.
@@ -520,17 +539,18 @@ files:
520
539
  - ext/mathematical/mtex2MML/CONTRIBUTING.md
521
540
  - ext/mathematical/mtex2MML/README.md
522
541
  - ext/mathematical/mtex2MML/SUPPORTED.md
523
- - ext/mathematical/mtex2MML/appveyor.yml
524
542
  - ext/mathematical/mtex2MML/cmake/Modules/astyle.cmake
525
543
  - ext/mathematical/mtex2MML/deps/uthash/package.json
526
544
  - ext/mathematical/mtex2MML/deps/uthash/utarray.h
527
545
  - ext/mathematical/mtex2MML/deps/uthash/uthash.h
528
546
  - ext/mathematical/mtex2MML/deps/uthash/utlist.h
529
547
  - ext/mathematical/mtex2MML/deps/uthash/utringbuffer.h
548
+ - ext/mathematical/mtex2MML/deps/uthash/utstack.h
530
549
  - ext/mathematical/mtex2MML/deps/uthash/utstring.h
531
550
  - ext/mathematical/mtex2MML/script/bootstrap
532
551
  - ext/mathematical/mtex2MML/script/cibuild
533
552
  - ext/mathematical/mtex2MML/script/tag
553
+ - ext/mathematical/mtex2MML/script/test-quick
534
554
  - ext/mathematical/mtex2MML/src/colors.c
535
555
  - ext/mathematical/mtex2MML/src/colors.h
536
556
  - ext/mathematical/mtex2MML/src/em.c
@@ -1283,6 +1303,15 @@ files:
1283
1303
  - ext/mathematical/mtex2MML/tests/numbered_equations.c
1284
1304
  - ext/mathematical/mtex2MML/tests/performance.c
1285
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
1286
1315
  - lib/mathematical.rb
1287
1316
  - lib/mathematical/configuration.rb
1288
1317
  - lib/mathematical/corrections.rb
@@ -1293,24 +1322,23 @@ homepage: https://github.com/gjtorikian/mathematical
1293
1322
  licenses:
1294
1323
  - MIT
1295
1324
  metadata: {}
1296
- post_install_message:
1325
+ post_install_message:
1297
1326
  rdoc_options: []
1298
1327
  require_paths:
1299
1328
  - lib
1300
- - ext
1301
1329
  required_ruby_version: !ruby/object:Gem::Requirement
1302
1330
  requirements:
1303
1331
  - - ">="
1304
1332
  - !ruby/object:Gem::Version
1305
- version: '0'
1333
+ version: '3.1'
1306
1334
  required_rubygems_version: !ruby/object:Gem::Requirement
1307
1335
  requirements:
1308
1336
  - - ">="
1309
1337
  - !ruby/object:Gem::Version
1310
1338
  version: '0'
1311
1339
  requirements: []
1312
- rubygems_version: 3.4.22
1313
- signing_key:
1340
+ rubygems_version: 3.5.22
1341
+ signing_key:
1314
1342
  specification_version: 4
1315
1343
  summary: Quickly convert math equations into beautiful SVGs/PNGs/MathML.
1316
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