Class: Antex::SetBox
- Inherits:
-
Measurable
- Object
- Measurable
- Antex::SetBox
- Defined in:
- lib/antex/set_box.rb
Overview
Encapsulates calculations and results for perfectly typesetting
the SVG vectorial conversion of a TeX box.
Three files are required by #load for initialization:
[+YAML+ file containing TeX measures]
We obtain this by using TeX directly
to measure the box and write to file.
Required metrics are ht, dp and wd (naturally expressed in +pt+s).
[+SVG+ picture fitting tfm metrics]
We obtain this by converting the DVI rendition of the box
to SVG using +dvisvgm+.
[+SVG+ picture fitting the ink]
We obtain this by converting the DVI rendition of the box
to SVG using +dvisvgm+
with the --exact flag.
After the initialization the calculations are performed immediatly. Six metrics become available:
mt,mr,mlandml(the margins, positive or negative)wdandht(width and height)ex(the default unit)
Defined Under Namespace
Classes: InvalidMeasure
Instance Attribute Summary
Attributes inherited from Measurable
Instance Method Summary collapse
-
#load(yml:, tfm:, fit:) ⇒ TexBox
Returns
selfafter loading.
Methods inherited from Measurable
Constructor Details
This class inherits a constructor from Antex::Measurable
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Antex::Measurable
Instance Method Details
#load(yml:, tfm:, fit:) ⇒ TexBox
Returns self after loading
32 33 34 35 36 37 38 39 40 41 |
# File 'lib/antex/set_box.rb', line 32 def load(yml:, tfm:, fit:) @tex = TexBox.new.load yml @tfm = SVGBox.new.load tfm @fit = SVGBox.new.load fit @tex.default_unit = :ex check_measures! self.measures = compute_measures self.default_unit = :ex self end |