├── .gitignore ├── COPYING ├── LICENSE.TXT ├── README.md ├── pom.xml └── src ├── main ├── java │ ├── com │ │ └── proudapes │ │ │ └── jlatexmathfx │ │ │ └── Control │ │ │ ├── LateXMathControl.java │ │ │ └── LateXMathSkin.java │ └── org │ │ └── scilab │ │ └── forge │ │ └── jlatexmath │ │ ├── AccentedAtom.java │ │ ├── AlphabetRegistration.java │ │ ├── AlphabetRegistrationException.java │ │ ├── ArrayOfAtoms.java │ │ ├── Atom.java │ │ ├── BigDelimiterAtom.java │ │ ├── BigOperatorAtom.java │ │ ├── BoldAtom.java │ │ ├── Box.java │ │ ├── BreakFormula.java │ │ ├── BreakMarkAtom.java │ │ ├── CedillaAtom.java │ │ ├── Char.java │ │ ├── CharAtom.java │ │ ├── CharBox.java │ │ ├── CharFont.java │ │ ├── CharSymbol.java │ │ ├── ColorAtom.java │ │ ├── CumulativeScriptsAtom.java │ │ ├── DdotsAtom.java │ │ ├── DefaultTeXFont.java │ │ ├── DefaultTeXFontParser.java │ │ ├── DelimiterFactory.java │ │ ├── DelimiterMappingNotFoundException.java │ │ ├── DoubleFramedAtom.java │ │ ├── Dummy.java │ │ ├── EmptyAtom.java │ │ ├── EmptyFormulaException.java │ │ ├── Extension.java │ │ ├── FBoxAtom.java │ │ ├── FcscoreAtom.java │ │ ├── FcscoreBox.java │ │ ├── FencedAtom.java │ │ ├── FixedCharAtom.java │ │ ├── FontAlreadyLoadedException.java │ │ ├── FontInfo.java │ │ ├── FormulaNotFoundException.java │ │ ├── FractionAtom.java │ │ ├── FramedBox.java │ │ ├── GCStroke.java │ │ ├── GeoGebraLogoAtom.java │ │ ├── GeoGebraLogoBox.java │ │ ├── Glue.java │ │ ├── GlueBox.java │ │ ├── GlueSettingsParser.java │ │ ├── GraphicsAtom.java │ │ ├── GraphicsBox.java │ │ ├── HdotsforAtom.java │ │ ├── HlineAtom.java │ │ ├── HorizontalBox.java │ │ ├── HorizontalRule.java │ │ ├── IJAtom.java │ │ ├── IddotsAtom.java │ │ ├── InvalidAtomTypeException.java │ │ ├── InvalidDelimiterException.java │ │ ├── InvalidDelimiterTypeException.java │ │ ├── InvalidMatrixException.java │ │ ├── InvalidSymbolTypeException.java │ │ ├── InvalidTeXFormulaException.java │ │ ├── InvalidUnitException.java │ │ ├── ItAtom.java │ │ ├── JMathTeXException.java │ │ ├── JavaFontRenderingAtom.java │ │ ├── JavaFontRenderingBox.java │ │ ├── LCaronAtom.java │ │ ├── LaTeXAtom.java │ │ ├── LapedAtom.java │ │ ├── MacroInfo.java │ │ ├── MathAtom.java │ │ ├── MatrixAtom.java │ │ ├── Metrics.java │ │ ├── MiddleAtom.java │ │ ├── MonoScaleAtom.java │ │ ├── MulticolumnAtom.java │ │ ├── MultlineAtom.java │ │ ├── NewCommandMacro.java │ │ ├── NewEnvironmentMacro.java │ │ ├── NthRoot.java │ │ ├── OgonekAtom.java │ │ ├── OvalAtom.java │ │ ├── OvalBox.java │ │ ├── OverBar.java │ │ ├── OverUnderBox.java │ │ ├── OverUnderDelimiter.java │ │ ├── OverlinedAtom.java │ │ ├── ParseException.java │ │ ├── ParseOption.java │ │ ├── PhantomAtom.java │ │ ├── PredefMacroInfo.java │ │ ├── PredefMacros.java │ │ ├── PredefinedCommands.java │ │ ├── PredefinedTeXFormulaParser.java │ │ ├── PredefinedTeXFormulas.java │ │ ├── RaiseAtom.java │ │ ├── ReflectAtom.java │ │ ├── ReflectBox.java │ │ ├── ResizeAtom.java │ │ ├── ResourceParseException.java │ │ ├── RomanAtom.java │ │ ├── RotateAtom.java │ │ ├── RotateBox.java │ │ ├── Row.java │ │ ├── RowAtom.java │ │ ├── RuleAtom.java │ │ ├── ScaleAtom.java │ │ ├── ScaleBox.java │ │ ├── ScriptsAtom.java │ │ ├── ShadowAtom.java │ │ ├── ShadowBox.java │ │ ├── SmallCapAtom.java │ │ ├── SmashedAtom.java │ │ ├── SpaceAtom.java │ │ ├── SsAtom.java │ │ ├── StrikeThroughAtom.java │ │ ├── StrutBox.java │ │ ├── StyleAtom.java │ │ ├── SymbolAtom.java │ │ ├── SymbolMappingNotFoundException.java │ │ ├── SymbolNotFoundException.java │ │ ├── TStrokeAtom.java │ │ ├── TeXConstants.java │ │ ├── TeXEnvironment.java │ │ ├── TeXFont.java │ │ ├── TeXFormula.java │ │ ├── TeXFormulaParser.java │ │ ├── TeXFormulaSettingsParser.java │ │ ├── TeXIcon.java │ │ ├── TeXParser.java │ │ ├── TeXSymbolParser.java │ │ ├── TextCircledAtom.java │ │ ├── TextStyleAtom.java │ │ ├── TextStyleMappingNotFoundException.java │ │ ├── TtAtom.java │ │ ├── TypedAtom.java │ │ ├── URLAlphabetRegistration.java │ │ ├── UnderOverArrowAtom.java │ │ ├── UnderOverAtom.java │ │ ├── UnderlinedAtom.java │ │ ├── UnderscoreAtom.java │ │ ├── VCenteredAtom.java │ │ ├── VRowAtom.java │ │ ├── VdotsAtom.java │ │ ├── VerticalBox.java │ │ ├── VlineAtom.java │ │ ├── WebStartAlphabetRegistration.java │ │ ├── XArrowAtom.java │ │ ├── XLeftRightArrowFactory.java │ │ ├── XMLResourceParseException.java │ │ ├── cyrillic │ │ └── CyrillicRegistration.java │ │ ├── dynamic │ │ ├── DynamicAtom.java │ │ ├── ExternalConverter.java │ │ └── ExternalConverterFactory.java │ │ ├── greek │ │ ├── COPYING │ │ ├── GreekRegistration.java │ │ ├── LICENSE │ │ └── MANIFEST.MF │ │ └── tcaronAtom.java └── resources │ ├── TeXFormulaSettings.xml │ └── org │ └── scilab │ └── forge │ └── jlatexmath │ ├── DefaultTeXFont.xml │ ├── GlueSettings.xml │ ├── TeXSymbols.xml │ ├── cyrillic │ ├── COPYING │ ├── LICENSE │ ├── MANIFEST.MF │ └── fonts │ │ ├── jlm_cyrillic.map.xml │ │ ├── jlm_wnbx10.ttf │ │ ├── jlm_wnbx10.xml │ │ ├── jlm_wnbxti10.ttf │ │ ├── jlm_wnbxti10.xml │ │ ├── jlm_wnr10.ttf │ │ ├── jlm_wnr10.xml │ │ ├── jlm_wnss10.ttf │ │ ├── jlm_wnss10.xml │ │ ├── jlm_wnssbx10.ttf │ │ ├── jlm_wnssbx10.xml │ │ ├── jlm_wnssi10.ttf │ │ ├── jlm_wnssi10.xml │ │ ├── jlm_wnti10.ttf │ │ ├── jlm_wnti10.xml │ │ ├── jlm_wntt10.ttf │ │ ├── jlm_wntt10.xml │ │ ├── language_cyrillic.xml │ │ ├── mappings_cyrillic.xml │ │ └── symbols_cyrillic.xml │ └── fonts │ ├── base │ ├── jlm_amsfonts.map.xml │ ├── jlm_amssymb.map.xml │ ├── jlm_base.map.xml │ ├── jlm_cmex10.ttf │ ├── jlm_cmex10.xml │ ├── jlm_cmmi10.ttf │ ├── jlm_cmmi10.xml │ ├── jlm_cmmi10_unchanged.xml │ ├── jlm_cmmib10.ttf │ ├── jlm_cmmib10.xml │ ├── jlm_cmmib10_unchanged.xml │ └── jlm_moustache.xml │ ├── euler │ ├── jlm_eufb10.ttf │ ├── jlm_eufb10.xml │ ├── jlm_eufm10.ttf │ └── jlm_eufm10.xml │ ├── greek │ ├── COPYING │ ├── LICENSE │ ├── MANIFEST.MF │ └── fonts │ │ ├── jlm_fcmbipg.ttf │ │ ├── jlm_fcmbipg.xml │ │ ├── jlm_fcmbpg.ttf │ │ ├── jlm_fcmbpg.xml │ │ ├── jlm_fcmripg.ttf │ │ ├── jlm_fcmripg.xml │ │ ├── jlm_fcmrpg.ttf │ │ ├── jlm_fcmrpg.xml │ │ ├── jlm_fcsbpg.ttf │ │ ├── jlm_fcsbpg.xml │ │ ├── jlm_fcsropg.ttf │ │ ├── jlm_fcsropg.xml │ │ ├── jlm_fcsrpg.ttf │ │ ├── jlm_fcsrpg.xml │ │ ├── jlm_fctrpg.ttf │ │ ├── jlm_fctrpg.xml │ │ ├── jlm_greek.map.xml │ │ ├── language_greek.xml │ │ ├── mappings_greek.xml │ │ └── symbols_greek.xml │ ├── latin │ ├── jlm_cmr10.ttf │ ├── jlm_cmr10.xml │ ├── jlm_jlmbi10.ttf │ ├── jlm_jlmbi10.xml │ ├── jlm_jlmbx10.ttf │ ├── jlm_jlmbx10.xml │ ├── jlm_jlmi10.ttf │ ├── jlm_jlmi10.xml │ ├── jlm_jlmr10.ttf │ ├── jlm_jlmr10.xml │ ├── jlm_jlmr10_unchanged.xml │ ├── jlm_jlmsb10.ttf │ ├── jlm_jlmsb10.xml │ ├── jlm_jlmsbi10.ttf │ ├── jlm_jlmsbi10.xml │ ├── jlm_jlmsi10.ttf │ ├── jlm_jlmsi10.xml │ ├── jlm_jlmss10.ttf │ ├── jlm_jlmss10.xml │ ├── jlm_jlmtt10.ttf │ ├── jlm_jlmtt10.xml │ └── optional │ │ ├── jlm_cmbx10.ttf │ │ ├── jlm_cmbx10.xml │ │ ├── jlm_cmbxti10.ttf │ │ ├── jlm_cmbxti10.xml │ │ ├── jlm_cmss10.ttf │ │ ├── jlm_cmss10.xml │ │ ├── jlm_cmssbx10.ttf │ │ ├── jlm_cmssbx10.xml │ │ ├── jlm_cmssi10.ttf │ │ ├── jlm_cmssi10.xml │ │ ├── jlm_cmti10.ttf │ │ ├── jlm_cmti10.xml │ │ ├── jlm_cmti10_unchanged.xml │ │ ├── jlm_cmtt10.ttf │ │ └── jlm_cmtt10.xml │ ├── licences │ ├── Knuth_License.txt │ ├── License_for_dsrom.txt │ └── OFL.txt │ └── maths │ ├── jlm_cmbsy10.ttf │ ├── jlm_cmbsy10.xml │ ├── jlm_cmsy10.ttf │ ├── jlm_cmsy10.xml │ ├── jlm_msam10.ttf │ ├── jlm_msam10.xml │ ├── jlm_msbm10.ttf │ ├── jlm_msbm10.xml │ ├── jlm_rsfs10.ttf │ ├── jlm_rsfs10.xml │ ├── jlm_special.map.xml │ ├── jlm_special.ttf │ ├── jlm_special.xml │ ├── jlm_stmary10.ttf │ ├── jlm_stmary10.xml │ ├── jlm_stmaryrd.map.xml │ └── optional │ ├── jlm_dsrom10.ttf │ └── jlm_dsrom10.xml ├── templates ├── Example1.png └── README.md └── test └── java └── com └── proudapes └── jlatexmathfx └── test ├── Example1.java ├── FXApp.java └── NoExceptionOnWrongFormula.java /.gitignore: -------------------------------------------------------------------------------- 1 | Example.png 2 | # Created by .ignore support plugin (hsz.mobi) 3 | ### Gradle template 4 | .gradle 5 | build/ 6 | 7 | # Ignore Gradle GUI config 8 | gradle-app.setting 9 | 10 | # Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored) 11 | !gradle-wrapper.jar 12 | ### Java template 13 | *.class 14 | 15 | # Mobile Tools for Java (J2ME) 16 | .mtj.tmp/ 17 | 18 | # Package Files # 19 | *.jar 20 | *.war 21 | *.ear 22 | 23 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 24 | hs_err_pid* 25 | ### JetBrains template 26 | # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio 27 | 28 | *.iml 29 | 30 | ## Directory-based project format: 31 | .idea/ 32 | # if you remove the above rule, at least ignore the following: 33 | 34 | # User-specific stuff: 35 | # .idea/workspace.xml 36 | # .idea/tasks.xml 37 | # .idea/dictionaries 38 | 39 | # Sensitive or high-churn files: 40 | # .idea/dataSources.ids 41 | # .idea/dataSources.xml 42 | # .idea/sqlDataSources.xml 43 | # .idea/dynamic.xml 44 | # .idea/uiDesigner.xml 45 | 46 | # Gradle: 47 | # .idea/gradle.xml 48 | # .idea/libraries 49 | 50 | # Mongo Explorer plugin: 51 | # .idea/mongoSettings.xml 52 | 53 | ## File-based project format: 54 | *.ipr 55 | *.iws 56 | 57 | ## Plugin-specific files: 58 | 59 | # IntelliJ 60 | /out/ 61 | 62 | # mpeltonen/sbt-idea plugin 63 | .idea_modules/ 64 | 65 | # JIRA plugin 66 | atlassian-ide-plugin.xml 67 | 68 | # Crashlytics plugin (for Android Studio and IntelliJ) 69 | com_crashlytics_export_strings.xml 70 | crashlytics.properties 71 | crashlytics-build.properties 72 | 73 | target/ 74 | pom.xml.tag 75 | pom.xml.releaseBackup 76 | pom.xml.versionsBackup 77 | pom.xml.next 78 | release.properties 79 | dependency-reduced-pom.xml 80 | buildNumber.properties 81 | .mvn/timing.properties 82 | 83 | # Avoid ignoring Maven wrapper jar file (.jar files are usually ignored) 84 | !/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /LICENSE.TXT: -------------------------------------------------------------------------------- 1 | JLaTeXMath Library - Displays LaTeX commands 2 | JLateXMath is an fork of JMathTeX with a lot of modifications to support many more LaTeX commands, drop of the jdom dependency and easy evolution capabilities. 3 | 4 | JLateXMathfx is a fork of JLateXMath to work with javafx 5 | 6 | 7 | Copyright (C) 2009-2011 DENIZET Calixte 8 | Copyright (C) Kris Coolsaet 9 | Copyright (C) Nico Van Cleemput 10 | Copyright (C) Kurt Vermeulen 11 | Copyright 2004-2007 Universiteit Gent 12 | 13 | Copyright (C) 2015 Fuad Abdallah 14 | 15 | 16 | This program is free software; you can redistribute it and/or modify 17 | it under the terms of the GNU General Public License as published by 18 | the Free Software Foundation; either version 2 of the License, or 19 | (at your option) any later version. 20 | 21 | This program is distributed in the hope that it will be useful, 22 | but WITHOUT ANY WARRANTY; without even the implied warranty of 23 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 24 | GNU General Public License for more details. 25 | 26 | You should have received a copy of the GNU General Public License 27 | along with this program; see the file COPYING. If not, write to the 28 | Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, 29 | MA 02110-1301, USA. 30 | 31 | 32 | 33 | The archive contains several fonts : 34 | 1) the fonts eufb10.ttf, eufm10.ttf, msam10.ttf and msbm10.ttf are under OFL (Open Font License); 35 | 36 | 2) the font dsrom10.ttf is under a free license; 37 | 38 | 3) the font stmary10.ttf and rsfs10.ttf are in PD (Public Domain); 39 | 40 | 4) the fonts cmbsy10.ttf, cmbx10.ttf, cmbxti10.ttf, cmex10.ttf, cmmi10.ttf, cmr10.ttf, cmss10.ttf, cmssbx10.ttf, cmsy10.ttf and cmtt10.ttf are under Knuth License. 41 | 42 | 5) the greek fonts fcmbipg.ttf, fcmripg.tff, fcmrpg.ttf, fcsropg.ttf, fcmbpg.ttf, fcsbpg.ttf, fctrpg.ttf, fcsrpg.ttf are under GNU GPL version 2. 43 | 44 | 6) the cyrillic fonts wnbx10.ttf, wnss10.ttf, wnti10.ttf, wnr10.ttf, wnssi10.ttf, wnbxti10.ttf, wnssbx10.ttf, wntt10.ttf are under Knuth License. 45 | 46 | You can find a copy of these licenses in org/scilab/forge/jlatexmath/fonts/licences. -------------------------------------------------------------------------------- /src/main/java/org/scilab/forge/jlatexmath/AlphabetRegistration.java: -------------------------------------------------------------------------------- 1 | /* AlphabetRegistration.java 2 | * ========================================================================= 3 | * This file is part of the JLaTeXMath Library - http://forge.scilab.org/jlatexmath 4 | * 5 | * Copyright (C) 2009 DENIZET Calixte 6 | * 7 | * This program is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or (at 10 | * your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, but 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * General Public License for more details. 16 | * 17 | * A copy of the GNU General Public License can be found in the file 18 | * LICENSE.txt provided with the source distribution of this program (see 19 | * the META-INF directory in the source jar). This license can also be 20 | * found on the GNU website at http://www.gnu.org/licenses/gpl.html. 21 | * 22 | * If you did not receive a copy of the GNU General Public License along 23 | * with this program, contact the lead developer, or write to the Free 24 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 25 | * 02110-1301, USA. 26 | * 27 | */ 28 | 29 | package org.scilab.forge.jlatexmath; 30 | 31 | public interface AlphabetRegistration { 32 | 33 | public static final Character.UnicodeBlock[] JLM_GREEK = new Character.UnicodeBlock[]{Character.UnicodeBlock.GREEK, Character.UnicodeBlock.GREEK_EXTENDED}; 34 | public static final Character.UnicodeBlock[] JLM_CYRILLIC = new Character.UnicodeBlock[]{Character.UnicodeBlock.CYRILLIC}; 35 | 36 | public Character.UnicodeBlock[] getUnicodeBlock(); 37 | 38 | public Object getPackage() throws AlphabetRegistrationException; 39 | 40 | public String getTeXFontFileName(); 41 | } -------------------------------------------------------------------------------- /src/main/java/org/scilab/forge/jlatexmath/AlphabetRegistrationException.java: -------------------------------------------------------------------------------- 1 | /* AlphabetRegistrationException.java 2 | * ========================================================================= 3 | * This file is originally of the JLaTeXMath Library - http://forge.scilab.org/jlatexmath 4 | * 5 | * Copyright (C) 2009 DENIZET Calixte 6 | * 7 | * This program is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or (at 10 | * your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, but 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * General Public License for more details. 16 | * 17 | * A copy of the GNU General Public License can be found in the file 18 | * LICENSE.txt provided with the source distribution of this program (see 19 | * the META-INF directory in the source jar). This license can also be 20 | * found on the GNU website at http://www.gnu.org/licenses/gpl.html. 21 | * 22 | * If you did not receive a copy of the GNU General Public License along 23 | * with this program, contact the lead developer, or write to the Free 24 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 25 | * 02110-1301, USA. 26 | * 27 | */ 28 | 29 | package org.scilab.forge.jlatexmath; 30 | 31 | /** 32 | * Signals that an error occured while registering an alphabet 33 | */ 34 | public class AlphabetRegistrationException extends Exception { 35 | 36 | protected AlphabetRegistrationException(String str) { 37 | super(str); 38 | } 39 | } -------------------------------------------------------------------------------- /src/main/java/org/scilab/forge/jlatexmath/BigDelimiterAtom.java: -------------------------------------------------------------------------------- 1 | /* BigDelimiterAtom.java 2 | * ========================================================================= 3 | * This file is part of the JLaTeXMath Library - http://forge.scilab.org/jlatexmath 4 | * 5 | * Copyright (C) 2009 DENIZET Calixte 6 | * 7 | * This program is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or (at 10 | * your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, but 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * General Public License for more details. 16 | * 17 | * A copy of the GNU General Public License can be found in the file 18 | * LICENSE.txt provided with the source distribution of this program (see 19 | * the META-INF directory in the source jar). This license can also be 20 | * found on the GNU website at http://www.gnu.org/licenses/gpl.html. 21 | * 22 | * If you did not receive a copy of the GNU General Public License along 23 | * with this program, contact the lead developer, or write to the Free 24 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 25 | * 02110-1301, USA. 26 | * 27 | */ 28 | 29 | package org.scilab.forge.jlatexmath; 30 | 31 | /** 32 | * An atom representing a big delimiter (for left and right commands). 33 | */ 34 | public class BigDelimiterAtom extends Atom { 35 | 36 | public SymbolAtom delim; 37 | private int size; 38 | 39 | public BigDelimiterAtom(SymbolAtom delim, int size) { 40 | this.delim = delim; 41 | this.size = size; 42 | } 43 | 44 | public Box createBox(TeXEnvironment env) { 45 | Box b = DelimiterFactory.create(delim, env, size); 46 | HorizontalBox hbox = new HorizontalBox(); 47 | final double h = b.getHeight(); 48 | final double total = h + b.getDepth(); 49 | final double axis = env.getTeXFont().getAxisHeight(env.getStyle()); 50 | b.setShift(-total / 2 + h - axis); 51 | hbox.add(b); 52 | return hbox; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/main/java/org/scilab/forge/jlatexmath/BoldAtom.java: -------------------------------------------------------------------------------- 1 | /* BoldAtom.java 2 | * ========================================================================= 3 | * This file is part of the JLaTeXMath Library - http://forge.scilab.org/jlatexmath 4 | * 5 | * Copyright (C) 2009 DENIZET Calixte 6 | * 7 | * This program is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or (at 10 | * your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, but 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * General Public License for more details. 16 | * 17 | * A copy of the GNU General Public License can be found in the file 18 | * LICENSE.txt provided with the source distribution of this program (see 19 | * the META-INF directory in the source jar). This license can also be 20 | * found on the GNU website at http://www.gnu.org/licenses/gpl.html. 21 | * 22 | * If you did not receive a copy of the GNU General Public License along 23 | * with this program, contact the lead developer, or write to the Free 24 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 25 | * 02110-1301, USA. 26 | * 27 | */ 28 | 29 | package org.scilab.forge.jlatexmath; 30 | 31 | /** 32 | * An atom representing a bold atom. 33 | */ 34 | public class BoldAtom extends Atom { 35 | 36 | private Atom base; 37 | 38 | public BoldAtom(Atom base) { 39 | this.base = base; 40 | } 41 | 42 | public Box createBox(TeXEnvironment env) { 43 | Box box; 44 | if (base != null) { 45 | env = env.copy(env.getTeXFont().copy()); 46 | env.getTeXFont().setBold(true); 47 | box = base.createBox(env); 48 | } else { 49 | box = new StrutBox(0, 0, 0, 0); 50 | } 51 | 52 | return box; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/main/java/org/scilab/forge/jlatexmath/BreakMarkAtom.java: -------------------------------------------------------------------------------- 1 | /* BreakMarkAtom.java 2 | * ========================================================================= 3 | * This file is part of the JLaTeXMath Library - http://forge.scilab.org/jlatexmath 4 | * 5 | * Copyright (C) 2010 DENIZET Calixte 6 | * 7 | * This program is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or (at 10 | * your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, but 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * General Public License for more details. 16 | * 17 | * A copy of the GNU General Public License can be found in the file 18 | * LICENSE.txt provided with the source distribution of this program (see 19 | * the META-INF directory in the source jar). This license can also be 20 | * found on the GNU website at http://www.gnu.org/licenses/gpl.html. 21 | * 22 | * If you did not receive a copy of the GNU General Public License along 23 | * with this program, contact the lead developer, or write to the Free 24 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 25 | * 02110-1301, USA. 26 | * 27 | */ 28 | 29 | package org.scilab.forge.jlatexmath; 30 | 31 | /** 32 | * An empty atom just to add a mark. 33 | */ 34 | public class BreakMarkAtom extends Atom { 35 | 36 | public BreakMarkAtom() { 37 | } 38 | 39 | public Box createBox(TeXEnvironment env) { 40 | return new StrutBox(0, 0, 0, 0); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/org/scilab/forge/jlatexmath/CedillaAtom.java: -------------------------------------------------------------------------------- 1 | /* CedillaAtom.java 2 | * ========================================================================= 3 | * This file is part of the JLaTeXMath Library - http://forge.scilab.org/jlatexmath 4 | * 5 | * Copyright (C) 2009 DENIZET Calixte 6 | * 7 | * This program is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or (at 10 | * your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, but 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * General Public License for more details. 16 | * 17 | * A copy of the GNU General Public License can be found in the file 18 | * LICENSE.txt provided with the source distribution of this program (see 19 | * the META-INF directory in the source jar). This license can also be 20 | * found on the GNU website at http://www.gnu.org/licenses/gpl.html. 21 | * 22 | * If you did not receive a copy of the GNU General Public License along 23 | * with this program, contact the lead developer, or write to the Free 24 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 25 | * 02110-1301, USA. 26 | * 27 | */ 28 | 29 | package org.scilab.forge.jlatexmath; 30 | 31 | /** 32 | * An atom with a cedilla. 33 | */ 34 | public class CedillaAtom extends Atom { 35 | 36 | private Atom base; 37 | 38 | public CedillaAtom(Atom base) { 39 | this.base = base; 40 | } 41 | 42 | public Box createBox(TeXEnvironment env) { 43 | Box b = base.createBox(env); 44 | VerticalBox vb = new VerticalBox(); 45 | vb.add(b); 46 | Char ch = env.getTeXFont().getChar("jlatexmathcedilla", env.getStyle()); 47 | double italic = ch.getItalic(); 48 | Box cedilla = new CharBox(ch); 49 | Box y; 50 | if (Math.abs(italic) > TeXFormula.PREC) { 51 | y = new HorizontalBox(new StrutBox(-italic, 0, 0, 0)); 52 | y.add(cedilla); 53 | } else { 54 | y = cedilla; 55 | } 56 | 57 | Box ce = new HorizontalBox(y, b.getWidth(), TeXConstants.ALIGN_CENTER); 58 | double x = 0.4f * SpaceAtom.getFactor(TeXConstants.UNIT_MU, env); 59 | vb.add(new StrutBox(0, -x, 0, 0)); 60 | vb.add(ce); 61 | double f = vb.getHeight() + vb.getDepth(); 62 | vb.setHeight(b.getHeight()); 63 | vb.setDepth(f - b.getHeight()); 64 | return vb; 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /src/main/java/org/scilab/forge/jlatexmath/Char.java: -------------------------------------------------------------------------------- 1 | /* Char.java 2 | * ========================================================================= 3 | * This file is originally part of the JMathTeX Library - http://jmathtex.sourceforge.net 4 | * 5 | * Copyright (C) 2004-2007 Universiteit Gent 6 | * Copyright (C) 2009 DENIZET Calixte 7 | * 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; either version 2 of the License, or (at 11 | * your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, but 14 | * WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * General Public License for more details. 17 | * 18 | * A copy of the GNU General Public License can be found in the file 19 | * LICENSE.txt provided with the source distribution of this program (see 20 | * the META-INF directory in the source jar). This license can also be 21 | * found on the GNU website at http://www.gnu.org/licenses/gpl.html. 22 | * 23 | * If you did not receive a copy of the GNU General Public License along 24 | * with this program, contact the lead developer, or write to the Free 25 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 26 | * 02110-1301, USA. 27 | * 28 | */ 29 | 30 | package org.scilab.forge.jlatexmath; 31 | 32 | import javafx.scene.text.Font; 33 | 34 | /** 35 | * Represents a character together with its font, font ID and metric information. 36 | */ 37 | public class Char { 38 | 39 | private final char c; 40 | private final Font font; 41 | private final Metrics m; 42 | private final int fontCode; 43 | 44 | public Char(char c, Font f, int fc, Metrics m) { 45 | font = f; 46 | fontCode = fc; 47 | this.c = c; 48 | this.m = m; 49 | } 50 | 51 | public CharFont getCharFont() { 52 | return new CharFont(c, fontCode); 53 | } 54 | 55 | public char getChar() { 56 | return c; 57 | } 58 | 59 | public Font getFont() { 60 | return font; 61 | } 62 | 63 | public int getFontCode() { 64 | return fontCode; 65 | } 66 | 67 | public double getWidth() { 68 | return m.getWidth(); 69 | } 70 | 71 | public double getItalic() { 72 | return m.getItalic(); 73 | } 74 | 75 | public double getHeight() { 76 | return m.getHeight(); 77 | } 78 | 79 | public double getDepth() { 80 | return m.getDepth(); 81 | } 82 | 83 | public Metrics getMetrics() { 84 | return m; 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /src/main/java/org/scilab/forge/jlatexmath/CharFont.java: -------------------------------------------------------------------------------- 1 | /* CharFont.java 2 | * ========================================================================= 3 | * This file is originally part of the JMathTeX Library - http://jmathtex.sourceforge.net 4 | * 5 | * Copyright (C) 2004-2007 Universiteit Gent 6 | * Copyright (C) 2009 DENIZET Calixte 7 | * 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; either version 2 of the License, or (at 11 | * your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, but 14 | * WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * General Public License for more details. 17 | * 18 | * A copy of the GNU General Public License can be found in the file 19 | * LICENSE.txt provided with the source distribution of this program (see 20 | * the META-INF directory in the source jar). This license can also be 21 | * found on the GNU website at http://www.gnu.org/licenses/gpl.html. 22 | * 23 | * If you did not receive a copy of the GNU General Public License along 24 | * with this program, contact the lead developer, or write to the Free 25 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 26 | * 02110-1301, USA. 27 | * 28 | */ 29 | 30 | package org.scilab.forge.jlatexmath; 31 | 32 | /** 33 | * Represents a specific character in a specific font (identified by its font ID). 34 | */ 35 | public class CharFont { 36 | 37 | public char c; 38 | public int fontId; 39 | public int boldFontId; 40 | 41 | public CharFont(char ch, int f) { 42 | this(ch, f, f); 43 | } 44 | 45 | public CharFont(char ch, int f, int bf) { 46 | c = ch; 47 | fontId = f; 48 | boldFontId = bf; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/main/java/org/scilab/forge/jlatexmath/CumulativeScriptsAtom.java: -------------------------------------------------------------------------------- 1 | /* ReflectAtom.java 2 | * ========================================================================= 3 | * This file is part of the JLaTeXMath Library - http://forge.scilab.org/jlatexmath 4 | * 5 | * Copyright (C) 2010 DENIZET Calixte 6 | * 7 | * This program is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or (at 10 | * your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, but 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * General Public License for more details. 16 | * 17 | * A copy of the GNU General Public License can be found in the file 18 | * LICENSE.txt provided with the source distribution of this program (see 19 | * the META-INF directory in the source jar). This license can also be 20 | * found on the GNU website at http://www.gnu.org/licenses/gpl.html. 21 | * 22 | * If you did not receive a copy of the GNU General Public License along 23 | * with this program, contact the lead developer, or write to the Free 24 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 25 | * 02110-1301, USA. 26 | * 27 | */ 28 | 29 | package org.scilab.forge.jlatexmath; 30 | 31 | /** 32 | * An atom representing a reflected Atom. 33 | */ 34 | public class CumulativeScriptsAtom extends Atom { 35 | 36 | private Atom base; 37 | private RowAtom sup; 38 | private RowAtom sub; 39 | 40 | public CumulativeScriptsAtom(Atom base, Atom sub, Atom sup) { 41 | super(); 42 | if (base instanceof CumulativeScriptsAtom) { 43 | CumulativeScriptsAtom at = (CumulativeScriptsAtom) base; 44 | this.base = at.base; 45 | at.sup.add(sup); 46 | at.sub.add(sub); 47 | this.sup = at.sup; 48 | this.sub = at.sub; 49 | } else { 50 | if (base == null) { 51 | this.base = new PhantomAtom(new CharAtom('M', "mathnormal"), false, true, true); 52 | } else { 53 | this.base = base; 54 | } 55 | this.sup = new RowAtom(sup); 56 | this.sub = new RowAtom(sub); 57 | } 58 | } 59 | 60 | public Box createBox(TeXEnvironment env) { 61 | return new ScriptsAtom(base, sub, sup).createBox(env); 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /src/main/java/org/scilab/forge/jlatexmath/DdotsAtom.java: -------------------------------------------------------------------------------- 1 | /* DdotsAtom.java 2 | * ========================================================================= 3 | * This file is part of the JLaTeXMath Library - http://forge.scilab.org/jlatexmath 4 | * 5 | * Copyright (C) 2009 DENIZET Calixte 6 | * 7 | * This program is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or (at 10 | * your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, but 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * General Public License for more details. 16 | * 17 | * A copy of the GNU General Public License can be found in the file 18 | * LICENSE.txt provided with the source distribution of this program (see 19 | * the META-INF directory in the source jar). This license can also be 20 | * found on the GNU website at http://www.gnu.org/licenses/gpl.html. 21 | * 22 | * If you did not receive a copy of the GNU General Public License along 23 | * with this program, contact the lead developer, or write to the Free 24 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 25 | * 02110-1301, USA. 26 | * 27 | */ 28 | 29 | package org.scilab.forge.jlatexmath; 30 | 31 | /** 32 | * An atom representing ddots. 33 | */ 34 | public class DdotsAtom extends Atom { 35 | 36 | public DdotsAtom() { 37 | } 38 | 39 | public Box createBox(TeXEnvironment env) { 40 | Box ldots = TeXFormula.get("ldots").root.createBox(env); 41 | double w = ldots.getWidth(); 42 | Box dot = SymbolAtom.get("ldotp").createBox(env); 43 | HorizontalBox hb1 = new HorizontalBox(dot, w, TeXConstants.ALIGN_LEFT); 44 | HorizontalBox hb2 = new HorizontalBox(dot, w, TeXConstants.ALIGN_CENTER); 45 | HorizontalBox hb3 = new HorizontalBox(dot, w, TeXConstants.ALIGN_RIGHT); 46 | Box pt4 = new SpaceAtom(TeXConstants.UNIT_MU, 0, 4, 0).createBox(env); 47 | VerticalBox vb = new VerticalBox(); 48 | vb.add(hb1); 49 | vb.add(pt4); 50 | vb.add(hb2); 51 | vb.add(pt4); 52 | vb.add(hb3); 53 | 54 | double h = vb.getHeight() + vb.getDepth(); 55 | vb.setHeight(h); 56 | vb.setDepth(0); 57 | 58 | return vb; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /src/main/java/org/scilab/forge/jlatexmath/DelimiterMappingNotFoundException.java: -------------------------------------------------------------------------------- 1 | /* DelimiterMappingNotFoundException.java 2 | * ========================================================================= 3 | * This file is originally part of the JMathTeX Library - http://jmathtex.sourceforge.net 4 | * 5 | * Copyright (C) 2004-2007 Universiteit Gent 6 | * Copyright (C) 2009 DENIZET Calixte 7 | * 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; either version 2 of the License, or (at 11 | * your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, but 14 | * WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * General Public License for more details. 17 | * 18 | * A copy of the GNU General Public License can be found in the file 19 | * LICENSE.txt provided with the source distribution of this program (see 20 | * the META-INF directory in the source jar). This license can also be 21 | * found on the GNU website at http://www.gnu.org/licenses/gpl.html. 22 | * 23 | * If you did not receive a copy of the GNU General Public License along 24 | * with this program, contact the lead developer, or write to the Free 25 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 26 | * 02110-1301, USA. 27 | * 28 | */ 29 | 30 | package org.scilab.forge.jlatexmath; 31 | 32 | /** 33 | * Signals a missing character-to-delimiter mapping. 34 | * 35 | * @author Kurt Vermeulen 36 | */ 37 | public class DelimiterMappingNotFoundException extends JMathTeXException { 38 | 39 | protected DelimiterMappingNotFoundException(char delimiter) { 40 | super("No mapping found for the character '" + delimiter + "'! " 41 | + "Insert a <" + TeXFormulaSettingsParser.CHARTODEL_MAPPING_EL 42 | + ">-element in '" + TeXFormulaSettingsParser.RESOURCE_NAME + "'."); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/org/scilab/forge/jlatexmath/DoubleFramedAtom.java: -------------------------------------------------------------------------------- 1 | /* FBoxAtom.java 2 | * ========================================================================= 3 | * This file is part of the JLaTeXMath Library - http://forge.scilab.org/jlatexmath 4 | * 5 | * Copyright (C) 2009 DENIZET Calixte 6 | * 7 | * This program is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or (at 10 | * your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, but 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * General Public License for more details. 16 | * 17 | * A copy of the GNU General Public License can be found in the file 18 | * LICENSE.txt provided with the source distribution of this program (see 19 | * the META-INF directory in the source jar). This license can also be 20 | * found on the GNU website at http://www.gnu.org/licenses/gpl.html. 21 | * 22 | * If you did not receive a copy of the GNU General Public License along 23 | * with this program, contact the lead developer, or write to the Free 24 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 25 | * 02110-1301, USA. 26 | * 27 | */ 28 | 29 | package org.scilab.forge.jlatexmath; 30 | 31 | 32 | /** 33 | * An atom representing a boxed base atom. 34 | */ 35 | public class DoubleFramedAtom extends FBoxAtom { 36 | 37 | public DoubleFramedAtom(Atom base) { 38 | super(base); 39 | } 40 | 41 | public Box createBox(TeXEnvironment env) { 42 | Box bbase = base.createBox(env); 43 | double drt = env.getTeXFont().getDefaultRuleThickness(env.getStyle()); 44 | double space = INTERSPACE * SpaceAtom.getFactor(TeXConstants.UNIT_EM, env); 45 | double sspace = 1.5f * drt + 0.5f * SpaceAtom.getFactor(TeXConstants.UNIT_POINT, env); 46 | return new FramedBox(new FramedBox(bbase, 0.75 * drt, space), 1.5f * drt, sspace); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/org/scilab/forge/jlatexmath/EmptyAtom.java: -------------------------------------------------------------------------------- 1 | /* EmptyAtom.java 2 | * ========================================================================= 3 | * This file is part of the JLaTeXMath Library - http://forge.scilab.org/jlatexmath 4 | * 5 | * Copyright (C) 2010 DENIZET Calixte 6 | * 7 | * This program is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or (at 10 | * your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, but 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * General Public License for more details. 16 | * 17 | * A copy of the GNU General Public License can be found in the file 18 | * LICENSE.txt provided with the source distribution of this program (see 19 | * the META-INF directory in the source jar). This license can also be 20 | * found on the GNU website at http://www.gnu.org/licenses/gpl.html. 21 | * 22 | * If you did not receive a copy of the GNU General Public License along 23 | * with this program, contact the lead developer, or write to the Free 24 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 25 | * 02110-1301, USA. 26 | * 27 | */ 28 | 29 | package org.scilab.forge.jlatexmath; 30 | 31 | /** 32 | * An empty atom. 33 | */ 34 | public class EmptyAtom extends Atom { 35 | 36 | public EmptyAtom() { 37 | } 38 | 39 | public Box createBox(TeXEnvironment env) { 40 | return new StrutBox(0, 0, 0, 0); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/org/scilab/forge/jlatexmath/EmptyFormulaException.java: -------------------------------------------------------------------------------- 1 | /* EmptyFormulaException.java 2 | * ========================================================================= 3 | * This file is originally part of the JMathTeX Library - http://jmathtex.sourceforge.net 4 | * 5 | * Copyright (C) 2004-2007 Universiteit Gent 6 | * Copyright (C) 2009 DENIZET Calixte 7 | * 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; either version 2 of the License, or (at 11 | * your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, but 14 | * WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * General Public License for more details. 17 | * 18 | * A copy of the GNU General Public License can be found in the file 19 | * LICENSE.txt provided with the source distribution of this program (see 20 | * the META-INF directory in the source jar). This license can also be 21 | * found on the GNU website at http://www.gnu.org/licenses/gpl.html. 22 | * 23 | * If you did not receive a copy of the GNU General Public License along 24 | * with this program, contact the lead developer, or write to the Free 25 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 26 | * 02110-1301, USA. 27 | * 28 | */ 29 | 30 | package org.scilab.forge.jlatexmath; 31 | 32 | public class EmptyFormulaException extends Exception { 33 | 34 | public EmptyFormulaException() { 35 | super("Illegal operation with an empty Formula!"); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/org/scilab/forge/jlatexmath/Extension.java: -------------------------------------------------------------------------------- 1 | /* Extension.java 2 | * ========================================================================= 3 | * This file is originally part of the JMathTeX Library - http://jmathtex.sourceforge.net 4 | * 5 | * Copyright (C) 2004-2007 Universiteit Gent 6 | * Copyright (C) 2009 DENIZET Calixte 7 | * 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; either version 2 of the License, or (at 11 | * your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, but 14 | * WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * General Public License for more details. 17 | * 18 | * A copy of the GNU General Public License can be found in the file 19 | * LICENSE.txt provided with the source distribution of this program (see 20 | * the META-INF directory in the source jar). This license can also be 21 | * found on the GNU website at http://www.gnu.org/licenses/gpl.html. 22 | * 23 | * If you did not receive a copy of the GNU General Public License along 24 | * with this program, contact the lead developer, or write to the Free 25 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 26 | * 02110-1301, USA. 27 | * 28 | */ 29 | 30 | package org.scilab.forge.jlatexmath; 31 | 32 | /** 33 | * Represents an extension character that is defined by Char-objects of it's 4 34 | * possible parts (null means part not present). 35 | */ 36 | public class Extension { 37 | 38 | // there ALLWAYS is a repeat character! (check TFM.isExtensionChar()) 39 | private final Char top; 40 | private final Char middle; 41 | private final Char bottom; 42 | private final Char repeat; 43 | 44 | public Extension(Char t, Char m, Char r, Char b) { 45 | top = t; 46 | middle = m; 47 | repeat = r; 48 | bottom = b; 49 | } 50 | 51 | public boolean hasTop() { 52 | return top != null; 53 | } 54 | 55 | public boolean hasMiddle() { 56 | return middle != null; 57 | } 58 | 59 | public boolean hasBottom() { 60 | return bottom != null; 61 | } 62 | 63 | public Char getTop() { 64 | return top; 65 | } 66 | 67 | public Char getMiddle() { 68 | return middle; 69 | } 70 | 71 | public Char getRepeat() { 72 | return repeat; 73 | } 74 | 75 | public Char getBottom() { 76 | return bottom; 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /src/main/java/org/scilab/forge/jlatexmath/FBoxAtom.java: -------------------------------------------------------------------------------- 1 | /* FBoxAtom.java 2 | * ========================================================================= 3 | * This file is part of the JLaTeXMath Library - http://forge.scilab.org/jlatexmath 4 | * 5 | * Copyright (C) 2009 DENIZET Calixte 6 | * 7 | * This program is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or (at 10 | * your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, but 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * General Public License for more details. 16 | * 17 | * A copy of the GNU General Public License can be found in the file 18 | * LICENSE.txt provided with the source distribution of this program (see 19 | * the META-INF directory in the source jar). This license can also be 20 | * found on the GNU website at http://www.gnu.org/licenses/gpl.html. 21 | * 22 | * If you did not receive a copy of the GNU General Public License along 23 | * with this program, contact the lead developer, or write to the Free 24 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 25 | * 02110-1301, USA. 26 | * 27 | */ 28 | 29 | package org.scilab.forge.jlatexmath; 30 | 31 | 32 | import javafx.scene.paint.Color; 33 | 34 | /** 35 | * An atom representing a boxed base atom. 36 | */ 37 | public class FBoxAtom extends Atom { 38 | 39 | public double INTERSPACE = 0.65f; 40 | 41 | // base atom 42 | protected final Atom base; 43 | protected Color bg = null, line = null; 44 | 45 | public FBoxAtom(Atom base) { 46 | if (base == null) 47 | this.base = new RowAtom(); // empty base 48 | else { 49 | this.base = base; 50 | this.type = base.type; 51 | } 52 | } 53 | 54 | public FBoxAtom(Atom base, Color bg, Color line) { 55 | this(base); 56 | this.bg = bg; 57 | this.line = line; 58 | } 59 | 60 | public Box createBox(TeXEnvironment env) { 61 | Box bbase = base.createBox(env); 62 | double drt = env.getTeXFont().getDefaultRuleThickness(env.getStyle()); 63 | double space = INTERSPACE * SpaceAtom.getFactor(TeXConstants.UNIT_EM, env); 64 | if (bg == null) { 65 | return new FramedBox(bbase, drt, space); 66 | } else { 67 | env.isColored = true; 68 | return new FramedBox(bbase, drt, space, line, bg); 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /src/main/java/org/scilab/forge/jlatexmath/FcscoreAtom.java: -------------------------------------------------------------------------------- 1 | /* FcscoreAtom.java 2 | * ========================================================================= 3 | * This file is part of the JLaTeXMath Library - http://forge.scilab.org/jlatexmath 4 | * 5 | * Copyright (C) 2013 DENIZET Calixte 6 | * 7 | * This program is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or (at 10 | * your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, but 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * General Public License for more details. 16 | * 17 | * A copy of the GNU General Public License can be found in the file 18 | * LICENSE.txt provided with the source distribution of this program (see 19 | * the META-INF directory in the source jar). This license can also be 20 | * found on the GNU website at http://www.gnu.org/licenses/gpl.html. 21 | * 22 | * If you did not receive a copy of the GNU General Public License along 23 | * with this program, contact the lead developer, or write to the Free 24 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 25 | * 02110-1301, USA. 26 | * 27 | */ 28 | 29 | package org.scilab.forge.jlatexmath; 30 | 31 | /** 32 | * An atom with representing an L with a caron. 33 | */ 34 | public class FcscoreAtom extends Atom { 35 | 36 | private int N; 37 | 38 | public FcscoreAtom(int N) { 39 | this.N = N; 40 | } 41 | 42 | public int getLeftType() { 43 | return TeXConstants.TYPE_ORDINARY; 44 | } 45 | 46 | public int getRightType() { 47 | return TeXConstants.TYPE_ORDINARY; 48 | } 49 | 50 | public Box createBox(TeXEnvironment env) { 51 | final double factor = 12 * SpaceAtom.getFactor(TeXConstants.UNIT_MU, env); 52 | 53 | return new FcscoreBox(N == 5 ? 4 : N, factor * 1f, factor * 0.07f, factor * 0.125f, N == 5); 54 | } 55 | } -------------------------------------------------------------------------------- /src/main/java/org/scilab/forge/jlatexmath/FixedCharAtom.java: -------------------------------------------------------------------------------- 1 | /* FixedCharAtom.java 2 | * ========================================================================= 3 | * This file is originally part of the JMathTeX Library - http://jmathtex.sourceforge.net 4 | * 5 | * Copyright (C) 2004-2007 Universiteit Gent 6 | * Copyright (C) 2009 DENIZET Calixte 7 | * 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; either version 2 of the License, or (at 11 | * your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, but 14 | * WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * General Public License for more details. 17 | * 18 | * A copy of the GNU General Public License can be found in the file 19 | * LICENSE.txt provided with the source distribution of this program (see 20 | * the META-INF directory in the source jar). This license can also be 21 | * found on the GNU website at http://www.gnu.org/licenses/gpl.html. 22 | * 23 | * If you did not receive a copy of the GNU General Public License along 24 | * with this program, contact the lead developer, or write to the Free 25 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 26 | * 02110-1301, USA. 27 | * 28 | */ 29 | 30 | package org.scilab.forge.jlatexmath; 31 | 32 | /** 33 | * An atom representing a fixed character (not depending on a text style). 34 | */ 35 | public class FixedCharAtom extends CharSymbol { 36 | 37 | private final CharFont cf; 38 | 39 | public FixedCharAtom(CharFont c) { 40 | cf = c; 41 | } 42 | 43 | public CharFont getCharFont(TeXFont tf) { 44 | return cf; 45 | } 46 | 47 | public Box createBox(TeXEnvironment env) { 48 | TeXFont tf = env.getTeXFont(); 49 | Char c = tf.getChar(cf, env.getStyle()); 50 | return new CharBox(c); 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /src/main/java/org/scilab/forge/jlatexmath/FontAlreadyLoadedException.java: -------------------------------------------------------------------------------- 1 | /* FontAlreadyLoadedException.java 2 | * ========================================================================= 3 | * This file is originally part of the JMathTeX Library - http://jmathtex.sourceforge.net 4 | * 5 | * Copyright (C) 2004-2007 Universiteit Gent 6 | * Copyright (C) 2009 DENIZET Calixte 7 | * 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; either version 2 of the License, or (at 11 | * your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, but 14 | * WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * General Public License for more details. 17 | * 18 | * A copy of the GNU General Public License can be found in the file 19 | * LICENSE.txt provided with the source distribution of this program (see 20 | * the META-INF directory in the source jar). This license can also be 21 | * found on the GNU website at http://www.gnu.org/licenses/gpl.html. 22 | * 23 | * If you did not receive a copy of the GNU General Public License along 24 | * with this program, contact the lead developer, or write to the Free 25 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 26 | * 02110-1301, USA. 27 | * 28 | */ 29 | 30 | package org.scilab.forge.jlatexmath; 31 | 32 | public class FontAlreadyLoadedException extends XMLResourceParseException { 33 | 34 | public FontAlreadyLoadedException(String msg) { 35 | super(msg); 36 | } 37 | } -------------------------------------------------------------------------------- /src/main/java/org/scilab/forge/jlatexmath/FormulaNotFoundException.java: -------------------------------------------------------------------------------- 1 | /* FormulaNotFoundException.java 2 | * ========================================================================= 3 | * This file is originally part of the JMathTeX Library - http://jmathtex.sourceforge.net 4 | * 5 | * Copyright (C) 2004-2007 Universiteit Gent 6 | * Copyright (C) 2009 DENIZET Calixte 7 | * 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; either version 2 of the License, or (at 11 | * your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, but 14 | * WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * General Public License for more details. 17 | * 18 | * A copy of the GNU General Public License can be found in the file 19 | * LICENSE.txt provided with the source distribution of this program (see 20 | * the META-INF directory in the source jar). This license can also be 21 | * found on the GNU website at http://www.gnu.org/licenses/gpl.html. 22 | * 23 | * If you did not receive a copy of the GNU General Public License along 24 | * with this program, contact the lead developer, or write to the Free 25 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 26 | * 02110-1301, USA. 27 | * 28 | */ 29 | 30 | package org.scilab.forge.jlatexmath; 31 | 32 | /** 33 | * Signals that unknown predefined TeXFormula name was used. 34 | * 35 | * @author Kurt Vermeulen 36 | */ 37 | public class FormulaNotFoundException extends JMathTeXException { 38 | 39 | protected FormulaNotFoundException(String name) { 40 | super("There's no predefined TeXFormula with the name '" + name 41 | + "' defined in '" + PredefinedTeXFormulaParser.RESOURCE_NAME 42 | + "'!"); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/org/scilab/forge/jlatexmath/GCStroke.java: -------------------------------------------------------------------------------- 1 | package org.scilab.forge.jlatexmath; 2 | 3 | import javafx.scene.canvas.GraphicsContext; 4 | import javafx.scene.shape.StrokeLineCap; 5 | import javafx.scene.shape.StrokeLineJoin; 6 | 7 | public class GCStroke { 8 | 9 | double width; 10 | StrokeLineCap cap; 11 | StrokeLineJoin join; 12 | double miterlimit; 13 | 14 | public GCStroke(double width, StrokeLineCap cap, StrokeLineJoin join, double miterlimit) { 15 | this.width = width; 16 | this.cap = cap; 17 | this.join = join; 18 | this.miterlimit = miterlimit; 19 | } 20 | 21 | public GCStroke(GraphicsContext gc) { 22 | this.width = gc.getLineWidth(); 23 | this.cap = gc.getLineCap(); 24 | this.join = gc.getLineJoin(); 25 | this.miterlimit = gc.getMiterLimit(); 26 | } 27 | 28 | public void setStroke(GraphicsContext gc) { 29 | gc.setLineWidth(width); 30 | gc.setLineCap(cap); 31 | gc.setLineJoin(join); 32 | gc.setMiterLimit(miterlimit); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/org/scilab/forge/jlatexmath/GeoGebraLogoAtom.java: -------------------------------------------------------------------------------- 1 | /* GeoGebraLogoAtom.java 2 | * ========================================================================= 3 | * This file is part of the JLaTeXMath Library - http://forge.scilab.org/jlatexmath 4 | * 5 | * Copyright (C) 2009 DENIZET Calixte 6 | * 7 | * This program is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or (at 10 | * your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, but 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * General Public License for more details. 16 | * 17 | * A copy of the GNU General Public License can be found in the file 18 | * LICENSE.txt provided with the source distribution of this program (see 19 | * the META-INF directory in the source jar). This license can also be 20 | * found on the GNU website at http://www.gnu.org/licenses/gpl.html. 21 | * 22 | * If you did not receive a copy of the GNU General Public License along 23 | * with this program, contact the lead developer, or write to the Free 24 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 25 | * 02110-1301, USA. 26 | * 27 | */ 28 | 29 | package org.scilab.forge.jlatexmath; 30 | 31 | public class GeoGebraLogoAtom extends Atom { 32 | 33 | public GeoGebraLogoAtom() { 34 | } 35 | 36 | public int getLeftType() { 37 | return TeXConstants.TYPE_ORDINARY; 38 | } 39 | 40 | public int getRightType() { 41 | return TeXConstants.TYPE_ORDINARY; 42 | } 43 | 44 | public Box createBox(TeXEnvironment env) { 45 | CharBox o = new CharBox(env.getTeXFont().getDefaultChar('o', env.getStyle())); 46 | return new GeoGebraLogoBox(o.width, o.height); 47 | } 48 | } -------------------------------------------------------------------------------- /src/main/java/org/scilab/forge/jlatexmath/GlueBox.java: -------------------------------------------------------------------------------- 1 | /* GlueBox.java 2 | * ========================================================================= 3 | * This file is originally part of the JMathTeX Library - http://jmathtex.sourceforge.net 4 | * 5 | * Copyright (C) 2004-2007 Universiteit Gent 6 | * Copyright (C) 2009 DENIZET Calixte 7 | * 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; either version 2 of the License, or (at 11 | * your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, but 14 | * WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * General Public License for more details. 17 | * 18 | * A copy of the GNU General Public License can be found in the file 19 | * LICENSE.txt provided with the source distribution of this program (see 20 | * the META-INF directory in the source jar). This license can also be 21 | * found on the GNU website at http://www.gnu.org/licenses/gpl.html. 22 | * 23 | * If you did not receive a copy of the GNU General Public License along 24 | * with this program, contact the lead developer, or write to the Free 25 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 26 | * 02110-1301, USA. 27 | * 28 | */ 29 | 30 | package org.scilab.forge.jlatexmath; 31 | 32 | import javafx.scene.canvas.GraphicsContext; 33 | 34 | 35 | /** 36 | * A box representing glue. 37 | */ 38 | public class GlueBox extends Box { 39 | 40 | protected double stretch = 0, shrink = 0; 41 | 42 | public GlueBox(double space, double stretch, double shrink) { 43 | this.width = space; 44 | this.stretch = stretch; 45 | this.shrink = shrink; 46 | } 47 | 48 | public void draw(GraphicsContext g2, double x, double y) { 49 | // no visible effect 50 | } 51 | 52 | public int getLastFontId() { 53 | return TeXFont.NO_FONT; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/main/java/org/scilab/forge/jlatexmath/GraphicsBox.java: -------------------------------------------------------------------------------- 1 | /* GraphicsBox.java 2 | * ========================================================================= 3 | * This file is part of the JLaTeXMath Library - http://forge.scilab.org/jlatexmath 4 | * 5 | * Copyright (C) 2009 DENIZET Calixte 6 | * 7 | * This program is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or (at 10 | * your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, but 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * General Public License for more details. 16 | * 17 | * A copy of the GNU General Public License can be found in the file 18 | * LICENSE.txt provided with the source distribution of this program (see 19 | * the META-INF directory in the source jar). This license can also be 20 | * found on the GNU website at http://www.gnu.org/licenses/gpl.html. 21 | * 22 | * If you did not receive a copy of the GNU General Public License along 23 | * with this program, contact the lead developer, or write to the Free 24 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 25 | * 02110-1301, USA. 26 | * 27 | */ 28 | 29 | package org.scilab.forge.jlatexmath; 30 | 31 | 32 | import javafx.scene.canvas.GraphicsContext; 33 | import javafx.scene.image.Image; 34 | import javafx.scene.transform.Affine; 35 | 36 | /** 37 | * A box representing a box containing a graphics. 38 | */ 39 | public class GraphicsBox extends Box { 40 | 41 | private Image image; 42 | private double scl; 43 | 44 | public GraphicsBox(Image image, double width, double height, double size) { 45 | this.image = image; 46 | this.width = width; 47 | this.height = height; 48 | this.scl = 1 / size; 49 | depth = 0; 50 | shift = 0; 51 | } 52 | 53 | public void draw(GraphicsContext g2, double x, double y) { 54 | Affine oldAt = g2.getTransform(); 55 | 56 | g2.translate(x, y - height); 57 | g2.scale(scl, scl); 58 | g2.drawImage(image, 0, 0); 59 | g2.setTransform(oldAt); 60 | } 61 | 62 | public int getLastFontId() { 63 | return 0; 64 | } 65 | } -------------------------------------------------------------------------------- /src/main/java/org/scilab/forge/jlatexmath/HdotsforAtom.java: -------------------------------------------------------------------------------- 1 | /* HdotsforAtom.java 2 | * ========================================================================= 3 | * This file is part of the JLaTeXMath Library - http://forge.scilab.org/jlatexmath 4 | * 5 | * Copyright (C) 2010 DENIZET Calixte 6 | * 7 | * This program is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or (at 10 | * your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, but 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * General Public License for more details. 16 | * 17 | * A copy of the GNU General Public License can be found in the file 18 | * LICENSE.txt provided with the source distribution of this program (see 19 | * the META-INF directory in the source jar). This license can also be 20 | * found on the GNU website at http://www.gnu.org/licenses/gpl.html. 21 | * 22 | * If you did not receive a copy of the GNU General Public License along 23 | * with this program, contact the lead developer, or write to the Free 24 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 25 | * 02110-1301, USA. 26 | * 27 | */ 28 | 29 | package org.scilab.forge.jlatexmath; 30 | 31 | /** 32 | * An atom used in array mode to write on several columns. 33 | */ 34 | public class HdotsforAtom extends MulticolumnAtom { 35 | 36 | private static final Atom ldotp = SymbolAtom.get("ldotp"); 37 | private static final Atom thin = new SpaceAtom(TeXConstants.THINMUSKIP); 38 | private double coeff; 39 | 40 | public HdotsforAtom(int n, double coeff) { 41 | super(n, "c", ldotp); 42 | this.coeff = coeff; 43 | } 44 | 45 | public Box createBox(TeXEnvironment env) { 46 | Box sp = new StrutBox(coeff * thin.createBox(env).getWidth(), 0, 0, 0); 47 | HorizontalBox db = new HorizontalBox(sp); 48 | db.add(ldotp.createBox(env)); 49 | db.add(sp); 50 | Box b; 51 | if (w != 0) { 52 | double dw = db.getWidth(); 53 | b = new HorizontalBox(db); 54 | while (b.getWidth() < w) { 55 | b.add(db); 56 | } 57 | b = new HorizontalBox(b, w, TeXConstants.ALIGN_CENTER); 58 | } else { 59 | b = db; 60 | } 61 | 62 | b.type = TeXConstants.TYPE_MULTICOLUMN; 63 | return b; 64 | } 65 | } -------------------------------------------------------------------------------- /src/main/java/org/scilab/forge/jlatexmath/HlineAtom.java: -------------------------------------------------------------------------------- 1 | /* HlineAtom.java 2 | * ========================================================================= 3 | * This file is part of the JLaTeXMath Library - http://forge.scilab.org/jlatexmath 4 | * 5 | * Copyright (C) 2009 DENIZET Calixte 6 | * 7 | * This program is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or (at 10 | * your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, but 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * General Public License for more details. 16 | * 17 | * A copy of the GNU General Public License can be found in the file 18 | * LICENSE.txt provided with the source distribution of this program (see 19 | * the META-INF directory in the source jar). This license can also be 20 | * found on the GNU website at http://www.gnu.org/licenses/gpl.html. 21 | * 22 | * If you did not receive a copy of the GNU General Public License along 23 | * with this program, contact the lead developer, or write to the Free 24 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 25 | * 02110-1301, USA. 26 | * 27 | */ 28 | 29 | package org.scilab.forge.jlatexmath; 30 | 31 | /** 32 | * An atom representing a hline in array environment 33 | */ 34 | public class HlineAtom extends Atom { 35 | 36 | private double width; 37 | private double shift; 38 | 39 | public HlineAtom() { 40 | } 41 | 42 | public void setWidth(double width) { 43 | this.width = width; 44 | } 45 | 46 | public void setShift(double shift) { 47 | this.shift = shift; 48 | } 49 | 50 | public Box createBox(TeXEnvironment env) { 51 | double drt = env.getTeXFont().getDefaultRuleThickness(env.getStyle()); 52 | Box b = new HorizontalRule(drt, width, shift, false); 53 | VerticalBox vb = new VerticalBox(); 54 | vb.add(b); 55 | vb.type = TeXConstants.TYPE_HLINE; 56 | return vb; 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/org/scilab/forge/jlatexmath/IJAtom.java: -------------------------------------------------------------------------------- 1 | /* IJAtom.java 2 | * ========================================================================= 3 | * This file is part of the JLaTeXMath Library - http://forge.scilab.org/jlatexmath 4 | * 5 | * Copyright (C) 2009 DENIZET Calixte 6 | * 7 | * This program is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or (at 10 | * your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, but 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * General Public License for more details. 16 | * 17 | * A copy of the GNU General Public License can be found in the file 18 | * LICENSE.txt provided with the source distribution of this program (see 19 | * the META-INF directory in the source jar). This license can also be 20 | * found on the GNU website at http://www.gnu.org/licenses/gpl.html. 21 | * 22 | * If you did not receive a copy of the GNU General Public License along 23 | * with this program, contact the lead developer, or write to the Free 24 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 25 | * 02110-1301, USA. 26 | * 27 | */ 28 | 29 | package org.scilab.forge.jlatexmath; 30 | 31 | /** 32 | * An atom with representing an IJ. 33 | */ 34 | public class IJAtom extends Atom { 35 | 36 | private boolean upper; 37 | 38 | public IJAtom(boolean upper) { 39 | this.upper = upper; 40 | } 41 | 42 | public Box createBox(TeXEnvironment env) { 43 | CharBox I = new CharBox(env.getTeXFont().getChar(upper ? 'I' : 'i', "mathnormal", env.getStyle())); 44 | CharBox J = new CharBox(env.getTeXFont().getChar(upper ? 'J' : 'j', "mathnormal", env.getStyle())); 45 | HorizontalBox hb = new HorizontalBox(I); 46 | hb.add(new SpaceAtom(TeXConstants.UNIT_EM, -0.065f, 0, 0).createBox(env)); 47 | hb.add(J); 48 | return hb; 49 | } 50 | } -------------------------------------------------------------------------------- /src/main/java/org/scilab/forge/jlatexmath/IddotsAtom.java: -------------------------------------------------------------------------------- 1 | /* IddotsAtom.java 2 | * ========================================================================= 3 | * This file is part of the JLaTeXMath Library - http://forge.scilab.org/jlatexmath 4 | * 5 | * Copyright (C) 2010 DENIZET Calixte 6 | * 7 | * This program is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or (at 10 | * your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, but 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * General Public License for more details. 16 | * 17 | * A copy of the GNU General Public License can be found in the file 18 | * LICENSE.txt provided with the source distribution of this program (see 19 | * the META-INF directory in the source jar). This license can also be 20 | * found on the GNU website at http://www.gnu.org/licenses/gpl.html. 21 | * 22 | * If you did not receive a copy of the GNU General Public License along 23 | * with this program, contact the lead developer, or write to the Free 24 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 25 | * 02110-1301, USA. 26 | * 27 | */ 28 | 29 | package org.scilab.forge.jlatexmath; 30 | 31 | /** 32 | * An atom representing iddots. 33 | */ 34 | public class IddotsAtom extends Atom { 35 | 36 | public IddotsAtom() { 37 | } 38 | 39 | public Box createBox(TeXEnvironment env) { 40 | Box ldots = TeXFormula.get("ldots").root.createBox(env); 41 | double w = ldots.getWidth(); 42 | Box dot = SymbolAtom.get("ldotp").createBox(env); 43 | HorizontalBox hb1 = new HorizontalBox(dot, w, TeXConstants.ALIGN_RIGHT); 44 | HorizontalBox hb2 = new HorizontalBox(dot, w, TeXConstants.ALIGN_CENTER); 45 | HorizontalBox hb3 = new HorizontalBox(dot, w, TeXConstants.ALIGN_LEFT); 46 | Box pt4 = new SpaceAtom(TeXConstants.UNIT_MU, 0, 4, 0).createBox(env); 47 | VerticalBox vb = new VerticalBox(); 48 | vb.add(hb1); 49 | vb.add(pt4); 50 | vb.add(hb2); 51 | vb.add(pt4); 52 | vb.add(hb3); 53 | 54 | double h = vb.getHeight() + vb.getDepth(); 55 | vb.setHeight(h); 56 | vb.setDepth(0); 57 | 58 | return vb; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /src/main/java/org/scilab/forge/jlatexmath/InvalidAtomTypeException.java: -------------------------------------------------------------------------------- 1 | /* InvalidAtomTypeException.java 2 | * ========================================================================= 3 | * This file is originally part of the JMathTeX Library - http://jmathtex.sourceforge.net 4 | * 5 | * Copyright (C) 2004-2007 Universiteit Gent 6 | * Copyright (C) 2009 DENIZET Calixte 7 | * 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; either version 2 of the License, or (at 11 | * your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, but 14 | * WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * General Public License for more details. 17 | * 18 | * A copy of the GNU General Public License can be found in the file 19 | * LICENSE.txt provided with the source distribution of this program (see 20 | * the META-INF directory in the source jar). This license can also be 21 | * found on the GNU website at http://www.gnu.org/licenses/gpl.html. 22 | * 23 | * If you did not receive a copy of the GNU General Public License along 24 | * with this program, contact the lead developer, or write to the Free 25 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 26 | * 02110-1301, USA. 27 | * 28 | */ 29 | 30 | package org.scilab.forge.jlatexmath; 31 | 32 | /** 33 | * Signals that an unknown atom type constant was used. 34 | * 35 | * @author Kurt Vermeulen 36 | */ 37 | public class InvalidAtomTypeException extends JMathTeXException { 38 | 39 | protected InvalidAtomTypeException(String msg) { 40 | super(msg); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/org/scilab/forge/jlatexmath/InvalidDelimiterException.java: -------------------------------------------------------------------------------- 1 | /* InvalidDelimiterException.java 2 | * ========================================================================= 3 | * This file is originally part of the JMathTeX Library - http://jmathtex.sourceforge.net 4 | * 5 | * Copyright (C) 2004-2007 Universiteit Gent 6 | * Copyright (C) 2009 DENIZET Calixte 7 | * 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; either version 2 of the License, or (at 11 | * your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, but 14 | * WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * General Public License for more details. 17 | * 18 | * A copy of the GNU General Public License can be found in the file 19 | * LICENSE.txt provided with the source distribution of this program (see 20 | * the META-INF directory in the source jar). This license can also be 21 | * found on the GNU website at http://www.gnu.org/licenses/gpl.html. 22 | * 23 | * If you did not receive a copy of the GNU General Public License along 24 | * with this program, contact the lead developer, or write to the Free 25 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 26 | * 02110-1301, USA. 27 | * 28 | */ 29 | 30 | package org.scilab.forge.jlatexmath; 31 | 32 | /** 33 | * Signals that a symbol, that was not defined as a delimiter, was used 34 | * as a delimiter. 35 | * 36 | * @author Kurt Vermeulen 37 | */ 38 | public class InvalidDelimiterException extends JMathTeXException { 39 | 40 | protected InvalidDelimiterException(String symbolName) { 41 | super("The symbol with the name '" + symbolName 42 | + "' is not defined as a delimiter (" 43 | + TeXSymbolParser.DELIMITER_ATTR + "='true') in '" 44 | + TeXSymbolParser.RESOURCE_NAME + "'!"); 45 | } 46 | 47 | protected InvalidDelimiterException(char ch, String symbolName) { 48 | super("The character '" + ch + "' is mapped to a symbol with the name '" 49 | + symbolName + "', but that symbol is not defined as a delimiter (" 50 | + TeXSymbolParser.DELIMITER_ATTR + "='true') in '" 51 | + TeXSymbolParser.RESOURCE_NAME + "'!"); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/main/java/org/scilab/forge/jlatexmath/InvalidDelimiterTypeException.java: -------------------------------------------------------------------------------- 1 | /* InvalidDelimiterTypeException.java 2 | * ========================================================================= 3 | * This file is originally part of the JMathTeX Library - http://jmathtex.sourceforge.net 4 | * 5 | * Copyright (C) 2004-2007 Universiteit Gent 6 | * Copyright (C) 2009 DENIZET Calixte 7 | * 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; either version 2 of the License, or (at 11 | * your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, but 14 | * WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * General Public License for more details. 17 | * 18 | * A copy of the GNU General Public License can be found in the file 19 | * LICENSE.txt provided with the source distribution of this program (see 20 | * the META-INF directory in the source jar). This license can also be 21 | * found on the GNU website at http://www.gnu.org/licenses/gpl.html. 22 | * 23 | * If you did not receive a copy of the GNU General Public License along 24 | * with this program, contact the lead developer, or write to the Free 25 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 26 | * 02110-1301, USA. 27 | * 28 | */ 29 | 30 | package org.scilab.forge.jlatexmath; 31 | 32 | /** 33 | * Signals that an unknown delimiter type constant was used. 34 | * 35 | * @author Kurt Vermeulen 36 | */ 37 | public class InvalidDelimiterTypeException extends JMathTeXException { 38 | 39 | protected InvalidDelimiterTypeException() { 40 | super( 41 | "The delimiter type was not valid! " 42 | + "Use one of the delimiter type constants from the class 'TeXConstants'."); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/org/scilab/forge/jlatexmath/InvalidMatrixException.java: -------------------------------------------------------------------------------- 1 | /* InvalidMatrixException.java 2 | * ========================================================================= 3 | * This file is originally part of the JMathTeX Library - http://jmathtex.sourceforge.net 4 | * 5 | * Copyright (C) 2004-2007 Universiteit Gent 6 | * Copyright (C) 2009 DENIZET Calixte 7 | * 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; either version 2 of the License, or (at 11 | * your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, but 14 | * WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * General Public License for more details. 17 | * 18 | * A copy of the GNU General Public License can be found in the file 19 | * LICENSE.txt provided with the source distribution of this program (see 20 | * the META-INF directory in the source jar). This license can also be 21 | * found on the GNU website at http://www.gnu.org/licenses/gpl.html. 22 | * 23 | * If you did not receive a copy of the GNU General Public License along 24 | * with this program, contact the lead developer, or write to the Free 25 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 26 | * 02110-1301, USA. 27 | * 28 | */ 29 | 30 | package org.scilab.forge.jlatexmath; 31 | 32 | /** 33 | * Signals a problem of dimensions in the matrix. 34 | * 35 | * @author Calixte Denizet 36 | */ 37 | public class InvalidMatrixException extends JMathTeXException { 38 | 39 | protected InvalidMatrixException(String msg) { 40 | super(msg); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/org/scilab/forge/jlatexmath/InvalidSymbolTypeException.java: -------------------------------------------------------------------------------- 1 | /* InvalidSymbolTypeException.java 2 | * ========================================================================= 3 | * This file is originally part of the JMathTeX Library - http://jmathtex.sourceforge.net 4 | * 5 | * Copyright (C) 2004-2007 Universiteit Gent 6 | * Copyright (C) 2009 DENIZET Calixte 7 | * 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; either version 2 of the License, or (at 11 | * your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, but 14 | * WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * General Public License for more details. 17 | * 18 | * A copy of the GNU General Public License can be found in the file 19 | * LICENSE.txt provided with the source distribution of this program (see 20 | * the META-INF directory in the source jar). This license can also be 21 | * found on the GNU website at http://www.gnu.org/licenses/gpl.html. 22 | * 23 | * If you did not receive a copy of the GNU General Public License along 24 | * with this program, contact the lead developer, or write to the Free 25 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 26 | * 02110-1301, USA. 27 | * 28 | */ 29 | 30 | package org.scilab.forge.jlatexmath; 31 | 32 | /** 33 | * Signals that an unknown symbol type constant or a symbol of the wrong type was used. 34 | * 35 | * @author Kurt Vermeulen 36 | */ 37 | public class InvalidSymbolTypeException extends JMathTeXException { 38 | 39 | protected InvalidSymbolTypeException(String msg) { 40 | super(msg); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/org/scilab/forge/jlatexmath/InvalidTeXFormulaException.java: -------------------------------------------------------------------------------- 1 | /* InvalidTeXFormulaException.java 2 | * ========================================================================= 3 | * This file is originally part of the JMathTeX Library - http://jmathtex.sourceforge.net 4 | * 5 | * Copyright (C) 2004-2007 Universiteit Gent 6 | * Copyright (C) 2009 DENIZET Calixte 7 | * 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; either version 2 of the License, or (at 11 | * your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, but 14 | * WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * General Public License for more details. 17 | * 18 | * A copy of the GNU General Public License can be found in the file 19 | * LICENSE.txt provided with the source distribution of this program (see 20 | * the META-INF directory in the source jar). This license can also be 21 | * found on the GNU website at http://www.gnu.org/licenses/gpl.html. 22 | * 23 | * If you did not receive a copy of the GNU General Public License along 24 | * with this program, contact the lead developer, or write to the Free 25 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 26 | * 02110-1301, USA. 27 | * 28 | */ 29 | 30 | package org.scilab.forge.jlatexmath; 31 | 32 | /** 33 | * Signals that an invalid TeXFormula was used. 34 | * 35 | * @author Kurt Vermeulen 36 | */ 37 | public class InvalidTeXFormulaException extends JMathTeXException { 38 | 39 | protected InvalidTeXFormulaException(String msg) { 40 | super(msg); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/org/scilab/forge/jlatexmath/InvalidUnitException.java: -------------------------------------------------------------------------------- 1 | /* InvalidUnitException.java 2 | * ========================================================================= 3 | * This file is originally part of the JMathTeX Library - http://jmathtex.sourceforge.net 4 | * 5 | * Copyright (C) 2004-2007 Universiteit Gent 6 | * Copyright (C) 2009 DENIZET Calixte 7 | * 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; either version 2 of the License, or (at 11 | * your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, but 14 | * WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * General Public License for more details. 17 | * 18 | * A copy of the GNU General Public License can be found in the file 19 | * LICENSE.txt provided with the source distribution of this program (see 20 | * the META-INF directory in the source jar). This license can also be 21 | * found on the GNU website at http://www.gnu.org/licenses/gpl.html. 22 | * 23 | * If you did not receive a copy of the GNU General Public License along 24 | * with this program, contact the lead developer, or write to the Free 25 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 26 | * 02110-1301, USA. 27 | * 28 | */ 29 | 30 | package org.scilab.forge.jlatexmath; 31 | 32 | /** 33 | * Signals that an unknown unit constant was used. 34 | * 35 | * @author Kurt Vermeulen 36 | */ 37 | public class InvalidUnitException extends JMathTeXException { 38 | 39 | protected InvalidUnitException() { 40 | super("The delimiter type was not valid! " 41 | + "Use one of the unit constants from the class 'TeXConstants'."); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/org/scilab/forge/jlatexmath/ItAtom.java: -------------------------------------------------------------------------------- 1 | /* ItAtom.java 2 | * ========================================================================= 3 | * This file is part of the JLaTeXMath Library - http://forge.scilab.org/jlatexmath 4 | * 5 | * Copyright (C) 2009 DENIZET Calixte 6 | * 7 | * This program is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or (at 10 | * your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, but 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * General Public License for more details. 16 | * 17 | * A copy of the GNU General Public License can be found in the file 18 | * LICENSE.txt provided with the source distribution of this program (see 19 | * the META-INF directory in the source jar). This license can also be 20 | * found on the GNU website at http://www.gnu.org/licenses/gpl.html. 21 | * 22 | * If you did not receive a copy of the GNU General Public License along 23 | * with this program, contact the lead developer, or write to the Free 24 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 25 | * 02110-1301, USA. 26 | * 27 | */ 28 | 29 | package org.scilab.forge.jlatexmath; 30 | 31 | /** 32 | * An atom representing a italic atom. 33 | */ 34 | public class ItAtom extends Atom { 35 | 36 | private Atom base; 37 | 38 | public ItAtom(Atom base) { 39 | this.base = base; 40 | } 41 | 42 | public Box createBox(TeXEnvironment env) { 43 | Box box; 44 | if (base != null) { 45 | env = env.copy(env.getTeXFont().copy()); 46 | env.getTeXFont().setIt(true); 47 | box = base.createBox(env); 48 | } else { 49 | box = new StrutBox(0, 0, 0, 0); 50 | } 51 | 52 | return box; 53 | } 54 | 55 | } -------------------------------------------------------------------------------- /src/main/java/org/scilab/forge/jlatexmath/JMathTeXException.java: -------------------------------------------------------------------------------- 1 | /* JMathTeXException.java 2 | * ========================================================================= 3 | * This file is originally part of the JMathTeX Library - http://jmathtex.sourceforge.net 4 | * 5 | * Copyright (C) 2004-2007 Universiteit Gent 6 | * Copyright (C) 2009 DENIZET Calixte 7 | * 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; either version 2 of the License, or (at 11 | * your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, but 14 | * WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * General Public License for more details. 17 | * 18 | * A copy of the GNU General Public License can be found in the file 19 | * LICENSE.txt provided with the source distribution of this program (see 20 | * the META-INF directory in the source jar). This license can also be 21 | * found on the GNU website at http://www.gnu.org/licenses/gpl.html. 22 | * 23 | * If you did not receive a copy of the GNU General Public License along 24 | * with this program, contact the lead developer, or write to the Free 25 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 26 | * 02110-1301, USA. 27 | * 28 | */ 29 | 30 | package org.scilab.forge.jlatexmath; 31 | 32 | /** 33 | * Superclass of all the possible (public) exceptions that can be thrown in this package. 34 | * 35 | * @author Kurt Vermeulen 36 | */ 37 | public class JMathTeXException extends RuntimeException { 38 | 39 | protected JMathTeXException(String msg) { 40 | super(msg); 41 | } 42 | 43 | protected JMathTeXException(String msg, Throwable cause) { 44 | super(msg, cause); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/org/scilab/forge/jlatexmath/LCaronAtom.java: -------------------------------------------------------------------------------- 1 | /* LCaronAtom.java 2 | * ========================================================================= 3 | * This file is part of the JLaTeXMath Library - http://forge.scilab.org/jlatexmath 4 | * 5 | * Copyright (C) 2009 DENIZET Calixte 6 | * 7 | * This program is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or (at 10 | * your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, but 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * General Public License for more details. 16 | * 17 | * A copy of the GNU General Public License can be found in the file 18 | * LICENSE.txt provided with the source distribution of this program (see 19 | * the META-INF directory in the source jar). This license can also be 20 | * found on the GNU website at http://www.gnu.org/licenses/gpl.html. 21 | * 22 | * If you did not receive a copy of the GNU General Public License along 23 | * with this program, contact the lead developer, or write to the Free 24 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 25 | * 02110-1301, USA. 26 | * 27 | */ 28 | 29 | package org.scilab.forge.jlatexmath; 30 | 31 | /** 32 | * An atom with representing an L with a caron. 33 | */ 34 | public class LCaronAtom extends Atom { 35 | 36 | private boolean upper; 37 | 38 | public LCaronAtom(boolean upper) { 39 | this.upper = upper; 40 | } 41 | 42 | public Box createBox(TeXEnvironment env) { 43 | CharBox A = new CharBox(env.getTeXFont().getChar("textapos", env.getStyle())); 44 | CharBox L = new CharBox(env.getTeXFont().getChar(upper ? 'L' : 'l', "mathnormal", env.getStyle())); 45 | HorizontalBox hb = new HorizontalBox(L); 46 | if (upper) 47 | hb.add(new SpaceAtom(TeXConstants.UNIT_EM, -0.3f, 0, 0).createBox(env)); 48 | else 49 | hb.add(new SpaceAtom(TeXConstants.UNIT_EM, -0.13f, 0, 0).createBox(env)); 50 | hb.add(A); 51 | return hb; 52 | } 53 | } -------------------------------------------------------------------------------- /src/main/java/org/scilab/forge/jlatexmath/LapedAtom.java: -------------------------------------------------------------------------------- 1 | /* LapedAtom.java 2 | * ========================================================================= 3 | * This file is part of the JLaTeXMath Library - http://forge.scilab.org/jlatexmath 4 | * 5 | * Copyright (C) 2009 DENIZET Calixte 6 | * 7 | * This program is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or (at 10 | * your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, but 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * General Public License for more details. 16 | * 17 | * A copy of the GNU General Public License can be found in the file 18 | * LICENSE.txt provided with the source distribution of this program (see 19 | * the META-INF directory in the source jar). This license can also be 20 | * found on the GNU website at http://www.gnu.org/licenses/gpl.html. 21 | * 22 | * If you did not receive a copy of the GNU General Public License along 23 | * with this program, contact the lead developer, or write to the Free 24 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 25 | * 02110-1301, USA. 26 | * 27 | */ 28 | 29 | package org.scilab.forge.jlatexmath; 30 | 31 | /** 32 | * An atom representing a laped atom (i.e. with no width). 33 | */ 34 | public class LapedAtom extends Atom { 35 | 36 | private Atom at; 37 | private char type; 38 | 39 | public LapedAtom(Atom at, char type) { 40 | this.at = at; 41 | this.type = type; 42 | } 43 | 44 | public Box createBox(TeXEnvironment env) { 45 | Box b = at.createBox(env); 46 | VerticalBox vb = new VerticalBox(); 47 | vb.add(b); 48 | vb.setWidth(0); 49 | switch (type) { 50 | case 'l': 51 | b.setShift(-b.getWidth()); 52 | break; 53 | case 'r': 54 | b.setShift(0); 55 | break; 56 | default: 57 | b.setShift(-b.getWidth() / 2); 58 | } 59 | 60 | return vb; 61 | } 62 | } -------------------------------------------------------------------------------- /src/main/java/org/scilab/forge/jlatexmath/MathAtom.java: -------------------------------------------------------------------------------- 1 | /* MathAtom.java 2 | * ========================================================================= 3 | * This file is part of the JLaTeXMath Library - http://forge.scilab.org/jlatexmath 4 | * 5 | * Copyright (C) 2011 DENIZET Calixte 6 | * 7 | * This program is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or (at 10 | * your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, but 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * General Public License for more details. 16 | * 17 | * A copy of the GNU General Public License can be found in the file 18 | * LICENSE.txt provided with the source distribution of this program (see 19 | * the META-INF directory in the source jar). This license can also be 20 | * found on the GNU website at http://www.gnu.org/licenses/gpl.html. 21 | * 22 | * If you did not receive a copy of the GNU General Public License along 23 | * with this program, contact the lead developer, or write to the Free 24 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 25 | * 02110-1301, USA. 26 | * 27 | */ 28 | 29 | package org.scilab.forge.jlatexmath; 30 | 31 | /** 32 | * An atom representing a math atom. 33 | */ 34 | public class MathAtom extends Atom { 35 | 36 | private int style = TeXConstants.STYLE_DISPLAY; 37 | protected Atom base; 38 | 39 | public MathAtom(Atom base, int style) { 40 | this.base = base; 41 | this.style = style; 42 | } 43 | 44 | public Box createBox(TeXEnvironment env) { 45 | env = env.copy(env.getTeXFont().copy()); 46 | env.getTeXFont().setRoman(false); 47 | int sstyle = env.getStyle(); 48 | env.setStyle(style); 49 | Box box = base.createBox(env); 50 | env.setStyle(sstyle); 51 | return box; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/main/java/org/scilab/forge/jlatexmath/Metrics.java: -------------------------------------------------------------------------------- 1 | /* Metrics.java 2 | * ========================================================================= 3 | * This file is originally part of the JMathTeX Library - http://jmathtex.sourceforge.net 4 | * 5 | * Copyright (C) 2004-2007 Universiteit Gent 6 | * Copyright (C) 2009 DENIZET Calixte 7 | * 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; either version 2 of the License, or (at 11 | * your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, but 14 | * WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * General Public License for more details. 17 | * 18 | * A copy of the GNU General Public License can be found in the file 19 | * LICENSE.txt provided with the source distribution of this program (see 20 | * the META-INF directory in the source jar). This license can also be 21 | * found on the GNU website at http://www.gnu.org/licenses/gpl.html. 22 | * 23 | * If you did not receive a copy of the GNU General Public License along 24 | * with this program, contact the lead developer, or write to the Free 25 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 26 | * 02110-1301, USA. 27 | * 28 | */ 29 | 30 | package org.scilab.forge.jlatexmath; 31 | 32 | /** 33 | * Contains the metrics for 1 character: width, height, depth and italic correction. 34 | */ 35 | public class Metrics { 36 | 37 | private final double w; 38 | private final double h; 39 | private final double d; 40 | private final double i; 41 | private final double s; 42 | 43 | public Metrics(double w, double h, double d, double i, double factor, double size) { 44 | this.w = w * factor; 45 | this.h = h * factor; 46 | this.d = d * factor; 47 | this.i = i * factor; 48 | this.s = size; 49 | } 50 | 51 | public double getWidth() { 52 | return w; 53 | } 54 | 55 | public double getHeight() { 56 | return h; 57 | } 58 | 59 | public double getDepth() { 60 | return d; 61 | } 62 | 63 | public double getItalic() { 64 | return i; 65 | } 66 | 67 | public double getSize() { 68 | return s; 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /src/main/java/org/scilab/forge/jlatexmath/MiddleAtom.java: -------------------------------------------------------------------------------- 1 | /* MiddleAtom.java 2 | * ========================================================================= 3 | * This file is part of the JLaTeXMath Library - http://forge.scilab.org/jlatexmath 4 | * 5 | * Copyright (C) 2009 DENIZET Calixte 6 | * 7 | * This program is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or (at 10 | * your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, but 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * General Public License for more details. 16 | * 17 | * A copy of the GNU General Public License can be found in the file 18 | * LICENSE.txt provided with the source distribution of this program (see 19 | * the META-INF directory in the source jar). This license can also be 20 | * found on the GNU website at http://www.gnu.org/licenses/gpl.html. 21 | * 22 | * If you did not receive a copy of the GNU General Public License along 23 | * with this program, contact the lead developer, or write to the Free 24 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 25 | * 02110-1301, USA. 26 | * 27 | */ 28 | 29 | package org.scilab.forge.jlatexmath; 30 | 31 | /** 32 | * An atom representing a middle atom which must be rounded by a left and right delimiter. 33 | */ 34 | public class MiddleAtom extends Atom { 35 | 36 | public Atom base; 37 | public Box box = new StrutBox(0, 0, 0, 0); 38 | 39 | public MiddleAtom(Atom at) { 40 | base = at; 41 | } 42 | 43 | public Box createBox(TeXEnvironment env) { 44 | return box; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/org/scilab/forge/jlatexmath/MonoScaleAtom.java: -------------------------------------------------------------------------------- 1 | /* MonoScaleAtom.java 2 | * ========================================================================= 3 | * This file is part of the JLaTeXMath Library - http://forge.scilab.org/jlatexmath 4 | * 5 | * Copyright (C) 2009 DENIZET Calixte 6 | * 7 | * This program is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or (at 10 | * your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, but 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * General Public License for more details. 16 | * 17 | * A copy of the GNU General Public License can be found in the file 18 | * LICENSE.txt provided with the source distribution of this program (see 19 | * the META-INF directory in the source jar). This license can also be 20 | * found on the GNU website at http://www.gnu.org/licenses/gpl.html. 21 | * 22 | * If you did not receive a copy of the GNU General Public License along 23 | * with this program, contact the lead developer, or write to the Free 24 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 25 | * 02110-1301, USA. 26 | * 27 | */ 28 | 29 | package org.scilab.forge.jlatexmath; 30 | 31 | /** 32 | * An atom representing a mono scale Atom. 33 | */ 34 | public class MonoScaleAtom extends ScaleAtom { 35 | 36 | private double factor; 37 | 38 | public MonoScaleAtom(Atom base, double factor) { 39 | super(base, (double) factor, (double) factor); 40 | this.factor = factor; 41 | } 42 | 43 | public Box createBox(TeXEnvironment env) { 44 | env = env.copy(); 45 | double f = env.getScaleFactor(); 46 | env.setScaleFactor(factor); 47 | return new ScaleBox(base.createBox(env), factor / f); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/org/scilab/forge/jlatexmath/NewEnvironmentMacro.java: -------------------------------------------------------------------------------- 1 | /* NewEnvironmentMacro.java 2 | * ========================================================================= 3 | * This file is part of the JLaTeXMath Library - http://forge.scilab.org/jlatexmath 4 | * 5 | * Copyright (C) 2009 DENIZET Calixte 6 | * 7 | * This program is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or (at 10 | * your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, but 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * General Public License for more details. 16 | * 17 | * A copy of the GNU General Public License can be found in the file 18 | * LICENSE.txt provided with the source distribution of this program (see 19 | * the META-INF directory in the source jar). This license can also be 20 | * found on the GNU website at http://www.gnu.org/licenses/gpl.html. 21 | * 22 | * If you did not receive a copy of the GNU General Public License along 23 | * with this program, contact the lead developer, or write to the Free 24 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 25 | * 02110-1301, USA. 26 | * 27 | */ 28 | 29 | package org.scilab.forge.jlatexmath; 30 | 31 | public class NewEnvironmentMacro extends NewCommandMacro { 32 | 33 | public NewEnvironmentMacro() { 34 | } 35 | 36 | public static void addNewEnvironment(String name, String begdef, String enddef, int nbArgs) throws ParseException { 37 | //if (macrocode.get(name + "@env") != null) 38 | //throw new ParseException("Environment " + name + " already exists ! Use renewenvironment instead ..."); 39 | addNewCommand(name + "@env", begdef + " #" + (nbArgs + 1) + " " + enddef, nbArgs + 1); 40 | } 41 | 42 | public static void addReNewEnvironment(String name, String begdef, String enddef, int nbArgs) throws ParseException { 43 | if (macrocode.get(name + "@env") == null) 44 | throw new ParseException("Environment " + name + "is not defined ! Use newenvironment instead ..."); 45 | addReNewCommand(name + "@env", begdef + " #" + (nbArgs + 1) + " " + enddef, nbArgs + 1); 46 | } 47 | } -------------------------------------------------------------------------------- /src/main/java/org/scilab/forge/jlatexmath/OgonekAtom.java: -------------------------------------------------------------------------------- 1 | /* OgonekAtom.java 2 | * ========================================================================= 3 | * This file is part of the JLaTeXMath Library - http://forge.scilab.org/jlatexmath 4 | * 5 | * Copyright (C) 2009 DENIZET Calixte 6 | * 7 | * This program is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or (at 10 | * your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, but 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * General Public License for more details. 16 | * 17 | * A copy of the GNU General Public License can be found in the file 18 | * LICENSE.txt provided with the source distribution of this program (see 19 | * the META-INF directory in the source jar). This license can also be 20 | * found on the GNU website at http://www.gnu.org/licenses/gpl.html. 21 | * 22 | * If you did not receive a copy of the GNU General Public License along 23 | * with this program, contact the lead developer, or write to the Free 24 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 25 | * 02110-1301, USA. 26 | * 27 | */ 28 | 29 | package org.scilab.forge.jlatexmath; 30 | 31 | /** 32 | * An atom with an ogonek. 33 | */ 34 | public class OgonekAtom extends Atom { 35 | 36 | private static final SymbolAtom ogonek = SymbolAtom.get("ogonek"); 37 | private Atom base; 38 | 39 | public OgonekAtom(Atom base) { 40 | this.base = base; 41 | } 42 | 43 | public Box createBox(TeXEnvironment env) { 44 | Box b = base.createBox(env); 45 | VerticalBox vb = new VerticalBox(); 46 | vb.add(b); 47 | Char ch = env.getTeXFont().getChar("ogonek", env.getStyle()); 48 | double italic = ch.getItalic(); 49 | Box ogonek = new CharBox(ch); 50 | Box y; 51 | if (Math.abs(italic) > TeXFormula.PREC) { 52 | y = new HorizontalBox(new StrutBox(-italic, 0, 0, 0)); 53 | y.add(ogonek); 54 | } else 55 | y = ogonek; 56 | 57 | Box og = new HorizontalBox(y, b.getWidth(), TeXConstants.ALIGN_RIGHT); 58 | vb.add(new StrutBox(0, -ogonek.getHeight(), 0, 0)); 59 | vb.add(og); 60 | double f = vb.getHeight() + vb.getDepth(); 61 | vb.setHeight(b.getHeight()); 62 | vb.setDepth(f - b.getHeight()); 63 | return vb; 64 | } 65 | } -------------------------------------------------------------------------------- /src/main/java/org/scilab/forge/jlatexmath/OvalAtom.java: -------------------------------------------------------------------------------- 1 | /* ShadowAtom.java 2 | * ========================================================================= 3 | * This file is part of the JLaTeXMath Library - http://forge.scilab.org/jlatexmath 4 | * 5 | * Copyright (C) 2009 DENIZET Calixte 6 | * 7 | * This program is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or (at 10 | * your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, but 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * General Public License for more details. 16 | * 17 | * A copy of the GNU General Public License can be found in the file 18 | * LICENSE.txt provided with the source distribution of this program (see 19 | * the META-INF directory in the source jar). This license can also be 20 | * found on the GNU website at http://www.gnu.org/licenses/gpl.html. 21 | * 22 | * If you did not receive a copy of the GNU General Public License along 23 | * with this program, contact the lead developer, or write to the Free 24 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 25 | * 02110-1301, USA. 26 | * 27 | */ 28 | 29 | package org.scilab.forge.jlatexmath; 30 | 31 | /** 32 | * An atom representing a boxed base atom. 33 | */ 34 | public class OvalAtom extends FBoxAtom { 35 | 36 | public OvalAtom(Atom base) { 37 | super(base); 38 | } 39 | 40 | public Box createBox(TeXEnvironment env) { 41 | return new OvalBox((FramedBox) super.createBox(env)); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/org/scilab/forge/jlatexmath/OvalBox.java: -------------------------------------------------------------------------------- 1 | /* OvalBox.java 2 | * ========================================================================= 3 | * This file is part of the JLaTeXMath Library - http://forge.scilab.org/jlatexmath 4 | * 5 | * Copyright (C) 2011 DENIZET Calixte 6 | * 7 | * This program is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or (at 10 | * your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, but 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * General Public License for more details. 16 | * 17 | * A copy of the GNU General Public License can be found in the file 18 | * LICENSE.txt provided with the source distribution of this program (see 19 | * the META-INF directory in the source jar). This license can also be 20 | * found on the GNU website at http://www.gnu.org/licenses/gpl.html. 21 | * 22 | * If you did not receive a copy of the GNU General Public License along 23 | * with this program, contact the lead developer, or write to the Free 24 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 25 | * 02110-1301, USA. 26 | * 27 | */ 28 | 29 | package org.scilab.forge.jlatexmath; 30 | 31 | 32 | import javafx.scene.canvas.GraphicsContext; 33 | import javafx.scene.shape.StrokeLineCap; 34 | import javafx.scene.shape.StrokeLineJoin; 35 | 36 | /** 37 | * A box representing a rotated box. 38 | */ 39 | public class OvalBox extends FramedBox { 40 | 41 | private float shadowRule; 42 | 43 | public OvalBox(FramedBox fbox) { 44 | super(fbox.box, fbox.thickness, fbox.space); 45 | } 46 | 47 | public void draw(GraphicsContext g2, double x, double y) { 48 | box.draw(g2, x + space + thickness, y); 49 | g2.save(); 50 | double th = thickness / 2; 51 | GCStroke s = new GCStroke(thickness, StrokeLineCap.BUTT, StrokeLineJoin.MITER, g2.getMiterLimit()); 52 | s.setStroke(g2); 53 | double r = 0.5f * Math.min(width - thickness, height + depth - thickness); 54 | g2.strokeRoundRect(x + th, y - height + th, width - thickness, height + depth - thickness, r, r); 55 | g2.restore(); 56 | } 57 | 58 | public int getLastFontId() { 59 | return box.getLastFontId(); 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /src/main/java/org/scilab/forge/jlatexmath/OverBar.java: -------------------------------------------------------------------------------- 1 | /* OverBar.java 2 | * ========================================================================= 3 | * This file is originally part of the JMathTeX Library - http://jmathtex.sourceforge.net 4 | * 5 | * Copyright (C) 2004-2007 Universiteit Gent 6 | * Copyright (C) 2009 DENIZET Calixte 7 | * 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; either version 2 of the License, or (at 11 | * your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, but 14 | * WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * General Public License for more details. 17 | * 18 | * A copy of the GNU General Public License can be found in the file 19 | * LICENSE.txt provided with the source distribution of this program (see 20 | * the META-INF directory in the source jar). This license can also be 21 | * found on the GNU website at http://www.gnu.org/licenses/gpl.html. 22 | * 23 | * If you did not receive a copy of the GNU General Public License along 24 | * with this program, contact the lead developer, or write to the Free 25 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 26 | * 02110-1301, USA. 27 | * 28 | */ 29 | 30 | package org.scilab.forge.jlatexmath; 31 | 32 | /** 33 | * A box representing another box with a horizontal rule above it, with appropriate 34 | * kerning. 35 | */ 36 | public class OverBar extends VerticalBox { 37 | 38 | public OverBar(Box b, double kern, double thickness) { 39 | // construct vertical box 40 | add(new StrutBox(0, thickness, 0, 0)); 41 | add(new HorizontalRule(thickness, b.getWidth(), 0)); 42 | add(new StrutBox(0, kern, 0, 0)); 43 | add(b); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/org/scilab/forge/jlatexmath/OverlinedAtom.java: -------------------------------------------------------------------------------- 1 | /* OverlinedAtom.java 2 | * ========================================================================= 3 | * This file is originally part of the JMathTeX Library - http://jmathtex.sourceforge.net 4 | * 5 | * Copyright (C) 2004-2007 Universiteit Gent 6 | * Copyright (C) 2009 DENIZET Calixte 7 | * 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; either version 2 of the License, or (at 11 | * your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, but 14 | * WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * General Public License for more details. 17 | * 18 | * A copy of the GNU General Public License can be found in the file 19 | * LICENSE.txt provided with the source distribution of this program (see 20 | * the META-INF directory in the source jar). This license can also be 21 | * found on the GNU website at http://www.gnu.org/licenses/gpl.html. 22 | * 23 | * If you did not receive a copy of the GNU General Public License along 24 | * with this program, contact the lead developer, or write to the Free 25 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 26 | * 02110-1301, USA. 27 | * 28 | */ 29 | 30 | package org.scilab.forge.jlatexmath; 31 | 32 | /** 33 | * An atom representing another atom with a horizontal line above it 34 | */ 35 | public class OverlinedAtom extends Atom { 36 | 37 | // base atom to be overlined 38 | private final Atom base; 39 | 40 | public OverlinedAtom(Atom f) { 41 | base = f; 42 | type = TeXConstants.TYPE_ORDINARY; 43 | } 44 | 45 | public Box createBox(TeXEnvironment env) { 46 | double drt = env.getTeXFont().getDefaultRuleThickness(env.getStyle()); 47 | 48 | // cramp the style of the formula to be overlined and create vertical box 49 | Box b = (base == null ? new StrutBox(0, 0, 0, 0) : base.createBox(env 50 | .crampStyle())); 51 | OverBar ob = new OverBar(b, 3 * drt, drt); 52 | 53 | // baseline vertical box = baseline box b 54 | ob.setDepth(b.getDepth()); 55 | ob.setHeight(b.getHeight() + 5 * drt); 56 | 57 | return ob; 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /src/main/java/org/scilab/forge/jlatexmath/ParseException.java: -------------------------------------------------------------------------------- 1 | /* ParseException.java 2 | * ========================================================================= 3 | * This file is originally part of the JMathTeX Library - http://jmathtex.sourceforge.net 4 | * 5 | * Copyright (C) 2004-2007 Universiteit Gent 6 | * Copyright (C) 2009 DENIZET Calixte 7 | * 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; either version 2 of the License, or (at 11 | * your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, but 14 | * WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * General Public License for more details. 17 | * 18 | * A copy of the GNU General Public License can be found in the file 19 | * LICENSE.txt provided with the source distribution of this program (see 20 | * the META-INF directory in the source jar). This license can also be 21 | * found on the GNU website at http://www.gnu.org/licenses/gpl.html. 22 | * 23 | * If you did not receive a copy of the GNU General Public License along 24 | * with this program, contact the lead developer, or write to the Free 25 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 26 | * 02110-1301, USA. 27 | * 28 | */ 29 | 30 | package org.scilab.forge.jlatexmath; 31 | 32 | /** 33 | * Signals that an error occured while parsing a string to a formula. 34 | */ 35 | public class ParseException extends JMathTeXException { 36 | 37 | public ParseException(String str, Throwable cause) { 38 | super(str, cause); 39 | } 40 | 41 | public ParseException(String str) { 42 | super(str); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/org/scilab/forge/jlatexmath/ParseOption.java: -------------------------------------------------------------------------------- 1 | /* ParseOption.java 2 | * ========================================================================= 3 | * This file is part of the JLaTeXMath Library - http://forge.scilab.org/jlatexmath 4 | * 5 | * Copyright (C) 2011 DENIZET Calixte 6 | * 7 | * This program is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or (at 10 | * your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, but 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * General Public License for more details. 16 | * 17 | * A copy of the GNU General Public License can be found in the file 18 | * LICENSE.txt provided with the source distribution of this program (see 19 | * the META-INF directory in the source jar). This license can also be 20 | * found on the GNU website at http://www.gnu.org/licenses/gpl.html. 21 | * 22 | * If you did not receive a copy of the GNU General Public License along 23 | * with this program, contact the lead developer, or write to the Free 24 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 25 | * 02110-1301, USA. 26 | * 27 | */ 28 | 29 | package org.scilab.forge.jlatexmath; 30 | 31 | import java.util.HashMap; 32 | import java.util.Map; 33 | import java.util.StringTokenizer; 34 | 35 | /** 36 | * Parse command options, e.g. \includegraphics[width=1cm,height=2in,keepaspectratio]{...} 37 | */ 38 | public final class ParseOption { 39 | 40 | public final static Map parseMap(String options) { 41 | Map map = new HashMap(); 42 | if (options == null || options.length() == 0) { 43 | return map; 44 | } 45 | StringTokenizer tokens = new StringTokenizer(options, ","); 46 | while (tokens.hasMoreTokens()) { 47 | String tok = tokens.nextToken().trim(); 48 | String[] optarg = tok.split("="); 49 | if (optarg != null) { 50 | if (optarg.length == 2) { 51 | map.put(optarg[0].trim(), optarg[1].trim()); 52 | } else if (optarg.length == 1) { 53 | map.put(optarg[0].trim(), null); 54 | } 55 | } 56 | } 57 | 58 | return map; 59 | } 60 | 61 | } -------------------------------------------------------------------------------- /src/main/java/org/scilab/forge/jlatexmath/ReflectAtom.java: -------------------------------------------------------------------------------- 1 | /* ReflectAtom.java 2 | * ========================================================================= 3 | * This file is part of the JLaTeXMath Library - http://forge.scilab.org/jlatexmath 4 | * 5 | * Copyright (C) 2009 DENIZET Calixte 6 | * 7 | * This program is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or (at 10 | * your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, but 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * General Public License for more details. 16 | * 17 | * A copy of the GNU General Public License can be found in the file 18 | * LICENSE.txt provided with the source distribution of this program (see 19 | * the META-INF directory in the source jar). This license can also be 20 | * found on the GNU website at http://www.gnu.org/licenses/gpl.html. 21 | * 22 | * If you did not receive a copy of the GNU General Public License along 23 | * with this program, contact the lead developer, or write to the Free 24 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 25 | * 02110-1301, USA. 26 | * 27 | */ 28 | 29 | package org.scilab.forge.jlatexmath; 30 | 31 | /** 32 | * An atom representing a reflected Atom. 33 | */ 34 | public class ReflectAtom extends Atom { 35 | 36 | private Atom base; 37 | 38 | public ReflectAtom(Atom base) { 39 | this.type = base.type; 40 | this.base = base; 41 | } 42 | 43 | public Box createBox(TeXEnvironment env) { 44 | return new ReflectBox(base.createBox(env)); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/org/scilab/forge/jlatexmath/ReflectBox.java: -------------------------------------------------------------------------------- 1 | /* ReflectBox.java 2 | * ========================================================================= 3 | * This file is part of the JLaTeXMath Library - http://forge.scilab.org/jlatexmath 4 | * 5 | * Copyright (C) 2009 DENIZET Calixte 6 | * 7 | * This program is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or (at 10 | * your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, but 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * General Public License for more details. 16 | * 17 | * A copy of the GNU General Public License can be found in the file 18 | * LICENSE.txt provided with the source distribution of this program (see 19 | * the META-INF directory in the source jar). This license can also be 20 | * found on the GNU website at http://www.gnu.org/licenses/gpl.html. 21 | * 22 | * If you did not receive a copy of the GNU General Public License along 23 | * with this program, contact the lead developer, or write to the Free 24 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 25 | * 02110-1301, USA. 26 | * 27 | */ 28 | 29 | package org.scilab.forge.jlatexmath; 30 | 31 | 32 | import javafx.scene.canvas.GraphicsContext; 33 | 34 | /** 35 | * A box representing a rotated box. 36 | */ 37 | public class ReflectBox extends Box { 38 | 39 | private Box box; 40 | 41 | public ReflectBox(Box b) { 42 | this.box = b; 43 | width = b.width; 44 | height = b.height; 45 | depth = b.depth; 46 | shift = b.shift; 47 | } 48 | 49 | public void draw(GraphicsContext g2, double x, double y) { 50 | g2.translate(x, y); 51 | g2.scale(-1, 1); 52 | box.draw(g2, -width, 0); 53 | g2.scale(-1, 1); 54 | g2.translate(-x, -y); 55 | } 56 | 57 | public int getLastFontId() { 58 | return box.getLastFontId(); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /src/main/java/org/scilab/forge/jlatexmath/ResourceParseException.java: -------------------------------------------------------------------------------- 1 | /* ResourceParseException.java 2 | * ========================================================================= 3 | * This file is originally part of the JMathTeX Library - http://jmathtex.sourceforge.net 4 | * 5 | * Copyright (C) 2004-2007 Universiteit Gent 6 | * Copyright (C) 2009 DENIZET Calixte 7 | * 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; either version 2 of the License, or (at 11 | * your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, but 14 | * WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * General Public License for more details. 17 | * 18 | * A copy of the GNU General Public License can be found in the file 19 | * LICENSE.txt provided with the source distribution of this program (see 20 | * the META-INF directory in the source jar). This license can also be 21 | * found on the GNU website at http://www.gnu.org/licenses/gpl.html. 22 | * 23 | * If you did not receive a copy of the GNU General Public License along 24 | * with this program, contact the lead developer, or write to the Free 25 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 26 | * 02110-1301, USA. 27 | * 28 | */ 29 | 30 | package org.scilab.forge.jlatexmath; 31 | 32 | /** 33 | * Signals that an error occurred while loading the necessary resources into memory. 34 | */ 35 | public class ResourceParseException extends JMathTeXException { 36 | 37 | protected ResourceParseException(String msg) { 38 | super(msg); 39 | } 40 | 41 | protected ResourceParseException(String msg, Throwable cause) { 42 | super(msg, cause); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/org/scilab/forge/jlatexmath/RomanAtom.java: -------------------------------------------------------------------------------- 1 | /* RomanAtom.java 2 | * ========================================================================= 3 | * This file is part of the JLaTeXMath Library - http://forge.scilab.org/jlatexmath 4 | * 5 | * Copyright (C) 2009 DENIZET Calixte 6 | * 7 | * This program is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or (at 10 | * your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, but 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * General Public License for more details. 16 | * 17 | * A copy of the GNU General Public License can be found in the file 18 | * LICENSE.txt provided with the source distribution of this program (see 19 | * the META-INF directory in the source jar). This license can also be 20 | * found on the GNU website at http://www.gnu.org/licenses/gpl.html. 21 | * 22 | * If you did not receive a copy of the GNU General Public License along 23 | * with this program, contact the lead developer, or write to the Free 24 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 25 | * 02110-1301, USA. 26 | * 27 | */ 28 | 29 | package org.scilab.forge.jlatexmath; 30 | 31 | /** 32 | * An atom representing a roman atom. 33 | */ 34 | public class RomanAtom extends Atom { 35 | 36 | protected Atom base; 37 | 38 | public RomanAtom(Atom base) { 39 | this.base = base; 40 | } 41 | 42 | public Box createBox(TeXEnvironment env) { 43 | Box box; 44 | if (base != null) { 45 | env = env.copy(env.getTeXFont().copy()); 46 | env.getTeXFont().setRoman(true); 47 | box = base.createBox(env); 48 | } else { 49 | box = new StrutBox(0, 0, 0, 0); 50 | } 51 | 52 | return box; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/main/java/org/scilab/forge/jlatexmath/Row.java: -------------------------------------------------------------------------------- 1 | /* Row.java 2 | * ========================================================================= 3 | * This file is originally part of the JMathTeX Library - http://jmathtex.sourceforge.net 4 | * 5 | * Copyright (C) 2004-2007 Universiteit Gent 6 | * Copyright (C) 2009 DENIZET Calixte 7 | * 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; either version 2 of the License, or (at 11 | * your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, but 14 | * WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * General Public License for more details. 17 | * 18 | * A copy of the GNU General Public License can be found in the file 19 | * LICENSE.txt provided with the source distribution of this program (see 20 | * the META-INF directory in the source jar). This license can also be 21 | * found on the GNU website at http://www.gnu.org/licenses/gpl.html. 22 | * 23 | * If you did not receive a copy of the GNU General Public License along 24 | * with this program, contact the lead developer, or write to the Free 25 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 26 | * 02110-1301, USA. 27 | * 28 | */ 29 | 30 | package org.scilab.forge.jlatexmath; 31 | 32 | /** 33 | * A "composed atom": an atom that consists of child atoms that will be displayed 34 | * next to each other horizontally with glue between them. 35 | */ 36 | public interface Row { 37 | 38 | /** 39 | * Sets the given dummy containing the atom that comes just before 40 | * the first child atom of this "composed atom". This method will allways be called 41 | * by another composed atom, so this composed atom will be a child of it (nested). 42 | * This is necessary to determine the glue to insert between the first child atom 43 | * of this nested composed atom and the atom that the dummy contains. 44 | * 45 | * @param dummy the dummy that comes just before this "composed atom" 46 | */ 47 | public void setPreviousAtom(Dummy dummy); 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/org/scilab/forge/jlatexmath/RuleAtom.java: -------------------------------------------------------------------------------- 1 | /* RuleAtom.java 2 | * ========================================================================= 3 | * This file is part of the JLaTeXMath Library - http://forge.scilab.org/jlatexmath 4 | * 5 | * Copyright (C) 2009 DENIZET Calixte 6 | * 7 | * This program is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or (at 10 | * your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, but 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * General Public License for more details. 16 | * 17 | * A copy of the GNU General Public License can be found in the file 18 | * LICENSE.txt provided with the source distribution of this program (see 19 | * the META-INF directory in the source jar). This license can also be 20 | * found on the GNU website at http://www.gnu.org/licenses/gpl.html. 21 | * 22 | * If you did not receive a copy of the GNU General Public License along 23 | * with this program, contact the lead developer, or write to the Free 24 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 25 | * 02110-1301, USA. 26 | * 27 | */ 28 | 29 | package org.scilab.forge.jlatexmath; 30 | 31 | /** 32 | * An atom representing a rule. 33 | */ 34 | public class RuleAtom extends Atom { 35 | 36 | private int wunit, hunit, runit; 37 | private double w, h, r; 38 | private SpaceAtom width, height, raise; 39 | 40 | public RuleAtom(int wunit, double width, int hunit, double height, int runit, double raise) { 41 | this.wunit = wunit; 42 | this.hunit = hunit; 43 | this.runit = runit; 44 | this.w = width; 45 | this.h = height; 46 | this.r = raise; 47 | } 48 | 49 | public Box createBox(TeXEnvironment env) { 50 | return new HorizontalRule(h * SpaceAtom.getFactor(hunit, env), w * SpaceAtom.getFactor(wunit, env), r * SpaceAtom.getFactor(runit, env)); 51 | } 52 | } -------------------------------------------------------------------------------- /src/main/java/org/scilab/forge/jlatexmath/ScaleAtom.java: -------------------------------------------------------------------------------- 1 | /* ScaleAtom.java 2 | * ========================================================================= 3 | * This file is part of the JLaTeXMath Library - http://forge.scilab.org/jlatexmath 4 | * 5 | * Copyright (C) 2009 DENIZET Calixte 6 | * 7 | * This program is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or (at 10 | * your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, but 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * General Public License for more details. 16 | * 17 | * A copy of the GNU General Public License can be found in the file 18 | * LICENSE.txt provided with the source distribution of this program (see 19 | * the META-INF directory in the source jar). This license can also be 20 | * found on the GNU website at http://www.gnu.org/licenses/gpl.html. 21 | * 22 | * If you did not receive a copy of the GNU General Public License along 23 | * with this program, contact the lead developer, or write to the Free 24 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 25 | * 02110-1301, USA. 26 | * 27 | */ 28 | 29 | package org.scilab.forge.jlatexmath; 30 | 31 | /** 32 | * An atom representing a scaled Atom. 33 | */ 34 | public class ScaleAtom extends Atom { 35 | 36 | protected Atom base; 37 | private double xscl, yscl; 38 | 39 | public ScaleAtom(Atom base, double xscl, double yscl) { 40 | this.type = base.type; 41 | this.base = base; 42 | this.xscl = xscl; 43 | this.yscl = yscl; 44 | } 45 | 46 | public int getLeftType() { 47 | return base.getLeftType(); 48 | } 49 | 50 | public int getRightType() { 51 | return base.getRightType(); 52 | } 53 | 54 | public Box createBox(TeXEnvironment env) { 55 | return new ScaleBox(base.createBox(env), xscl, yscl); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /src/main/java/org/scilab/forge/jlatexmath/ShadowAtom.java: -------------------------------------------------------------------------------- 1 | /* ShadowAtom.java 2 | * ========================================================================= 3 | * This file is part of the JLaTeXMath Library - http://forge.scilab.org/jlatexmath 4 | * 5 | * Copyright (C) 2009 DENIZET Calixte 6 | * 7 | * This program is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or (at 10 | * your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, but 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * General Public License for more details. 16 | * 17 | * A copy of the GNU General Public License can be found in the file 18 | * LICENSE.txt provided with the source distribution of this program (see 19 | * the META-INF directory in the source jar). This license can also be 20 | * found on the GNU website at http://www.gnu.org/licenses/gpl.html. 21 | * 22 | * If you did not receive a copy of the GNU General Public License along 23 | * with this program, contact the lead developer, or write to the Free 24 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 25 | * 02110-1301, USA. 26 | * 27 | */ 28 | 29 | package org.scilab.forge.jlatexmath; 30 | 31 | 32 | /** 33 | * An atom representing a boxed base atom. 34 | */ 35 | public class ShadowAtom extends FBoxAtom { 36 | 37 | public ShadowAtom(Atom base) { 38 | super(base); 39 | } 40 | 41 | public Box createBox(TeXEnvironment env) { 42 | return new ShadowBox((FramedBox) super.createBox(env), env.getTeXFont().getDefaultRuleThickness(env.getStyle()) * 4); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/org/scilab/forge/jlatexmath/SmallCapAtom.java: -------------------------------------------------------------------------------- 1 | /* RomanAtom.java 2 | * ========================================================================= 3 | * This file is part of the JLaTeXMath Library - http://forge.scilab.org/jlatexmath 4 | * 5 | * Copyright (C) 2009 DENIZET Calixte 6 | * 7 | * This program is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or (at 10 | * your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, but 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * General Public License for more details. 16 | * 17 | * A copy of the GNU General Public License can be found in the file 18 | * LICENSE.txt provided with the source distribution of this program (see 19 | * the META-INF directory in the source jar). This license can also be 20 | * found on the GNU website at http://www.gnu.org/licenses/gpl.html. 21 | * 22 | * If you did not receive a copy of the GNU General Public License along 23 | * with this program, contact the lead developer, or write to the Free 24 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 25 | * 02110-1301, USA. 26 | * 27 | */ 28 | 29 | package org.scilab.forge.jlatexmath; 30 | 31 | /** 32 | * An atom representing a small capital atom. 33 | */ 34 | public class SmallCapAtom extends Atom { 35 | 36 | protected Atom base; 37 | 38 | public SmallCapAtom(Atom base) { 39 | this.base = base; 40 | } 41 | 42 | public Box createBox(TeXEnvironment env) { 43 | boolean prev = env.getSmallCap(); 44 | env.setSmallCap(true); 45 | Box box = base.createBox(env); 46 | env.setSmallCap(prev); 47 | return box; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/org/scilab/forge/jlatexmath/SmashedAtom.java: -------------------------------------------------------------------------------- 1 | /* SmashedAtom.java 2 | * ========================================================================= 3 | * This file is part of the JLaTeXMath Library - http://forge.scilab.org/jlatexmath 4 | * 5 | * Copyright (C) 2009 DENIZET Calixte 6 | * 7 | * This program is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or (at 10 | * your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, but 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * General Public License for more details. 16 | * 17 | * A copy of the GNU General Public License can be found in the file 18 | * LICENSE.txt provided with the source distribution of this program (see 19 | * the META-INF directory in the source jar). This license can also be 20 | * found on the GNU website at http://www.gnu.org/licenses/gpl.html. 21 | * 22 | * If you did not receive a copy of the GNU General Public License along 23 | * with this program, contact the lead developer, or write to the Free 24 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 25 | * 02110-1301, USA. 26 | * 27 | */ 28 | 29 | package org.scilab.forge.jlatexmath; 30 | 31 | /** 32 | * An atom representing a smashed atom (i.e. with no height and no depth). 33 | */ 34 | public class SmashedAtom extends Atom { 35 | 36 | private Atom at; 37 | private boolean h = true, d = true; 38 | 39 | public SmashedAtom(Atom at, String opt) { 40 | this.at = at; 41 | if ("t".equals(opt)) 42 | d = false; 43 | else if ("b".equals(opt)) 44 | h = false; 45 | } 46 | 47 | public Box createBox(TeXEnvironment env) { 48 | Box b = at.createBox(env); 49 | if (h) 50 | b.setHeight(0); 51 | if (d) 52 | b.setDepth(0); 53 | return b; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/main/java/org/scilab/forge/jlatexmath/SsAtom.java: -------------------------------------------------------------------------------- 1 | /* SsAtom.java 2 | * ========================================================================= 3 | * This file is part of the JLaTeXMath Library - http://forge.scilab.org/jlatexmath 4 | * 5 | * Copyright (C) 2009 DENIZET Calixte 6 | * 7 | * This program is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or (at 10 | * your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, but 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * General Public License for more details. 16 | * 17 | * A copy of the GNU General Public License can be found in the file 18 | * LICENSE.txt provided with the source distribution of this program (see 19 | * the META-INF directory in the source jar). This license can also be 20 | * found on the GNU website at http://www.gnu.org/licenses/gpl.html. 21 | * 22 | * If you did not receive a copy of the GNU General Public License along 23 | * with this program, contact the lead developer, or write to the Free 24 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 25 | * 02110-1301, USA. 26 | * 27 | */ 28 | 29 | package org.scilab.forge.jlatexmath; 30 | 31 | /** 32 | * An atom representing a sans serif atom. 33 | */ 34 | public class SsAtom extends Atom { 35 | 36 | private Atom base; 37 | 38 | public SsAtom(Atom base) { 39 | this.base = base; 40 | } 41 | 42 | public Box createBox(TeXEnvironment env) { 43 | env = env.copy(env.getTeXFont().copy()); 44 | env.getTeXFont().setSs(true); 45 | Box box = base.createBox(env); 46 | env.getTeXFont().setSs(false); 47 | return box; 48 | } 49 | 50 | } -------------------------------------------------------------------------------- /src/main/java/org/scilab/forge/jlatexmath/StrikeThroughAtom.java: -------------------------------------------------------------------------------- 1 | /* SmashedAtom.java 2 | * ========================================================================= 3 | * This file is part of the JLaTeXMath Library - http://forge.scilab.org/jlatexmath 4 | * 5 | * Copyright (C) 2013 DENIZET Calixte 6 | * 7 | * This program is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or (at 10 | * your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, but 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * General Public License for more details. 16 | * 17 | * A copy of the GNU General Public License can be found in the file 18 | * LICENSE.txt provided with the source distribution of this program (see 19 | * the META-INF directory in the source jar). This license can also be 20 | * found on the GNU website at http://www.gnu.org/licenses/gpl.html. 21 | * 22 | * If you did not receive a copy of the GNU General Public License along 23 | * with this program, contact the lead developer, or write to the Free 24 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 25 | * 02110-1301, USA. 26 | * 27 | */ 28 | 29 | package org.scilab.forge.jlatexmath; 30 | 31 | /** 32 | * An atom representing a smashed atom (i.e. with no height and no depth). 33 | */ 34 | public class StrikeThroughAtom extends Atom { 35 | 36 | private Atom at; 37 | 38 | public StrikeThroughAtom(Atom at) { 39 | this.at = at; 40 | } 41 | 42 | public Box createBox(TeXEnvironment env) { 43 | TeXFont tf = env.getTeXFont(); 44 | int style = env.getStyle(); 45 | double axis = tf.getAxisHeight(style); 46 | double drt = tf.getDefaultRuleThickness(style); 47 | Box b = at.createBox(env); 48 | HorizontalRule rule = new HorizontalRule(drt, b.getWidth(), -axis + drt, false); 49 | HorizontalBox hb = new HorizontalBox(); 50 | hb.add(b); 51 | hb.add(new StrutBox(-b.getWidth(), 0, 0, 0)); 52 | hb.add(rule); 53 | 54 | return hb; 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /src/main/java/org/scilab/forge/jlatexmath/StrutBox.java: -------------------------------------------------------------------------------- 1 | /* StrutBox.java 2 | * ========================================================================= 3 | * This file is originally part of the JMathTeX Library - http://jmathtex.sourceforge.net 4 | * 5 | * Copyright (C) 2004-2007 Universiteit Gent 6 | * Copyright (C) 2009 DENIZET Calixte 7 | * 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; either version 2 of the License, or (at 11 | * your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, but 14 | * WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * General Public License for more details. 17 | * 18 | * A copy of the GNU General Public License can be found in the file 19 | * LICENSE.txt provided with the source distribution of this program (see 20 | * the META-INF directory in the source jar). This license can also be 21 | * found on the GNU website at http://www.gnu.org/licenses/gpl.html. 22 | * 23 | * If you did not receive a copy of the GNU General Public License along 24 | * with this program, contact the lead developer, or write to the Free 25 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 26 | * 02110-1301, USA. 27 | * 28 | */ 29 | 30 | package org.scilab.forge.jlatexmath; 31 | 32 | 33 | import javafx.scene.canvas.GraphicsContext; 34 | 35 | /** 36 | * A box representing whitespace. 37 | */ 38 | public class StrutBox extends Box { 39 | 40 | public StrutBox(double w, double h, double d, double s) { 41 | width = w; 42 | height = h; 43 | depth = d; 44 | shift = s; 45 | } 46 | 47 | public void draw(GraphicsContext g2, double x, double y) { 48 | // no visual effect 49 | } 50 | 51 | public int getLastFontId() { 52 | return TeXFont.NO_FONT; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/main/java/org/scilab/forge/jlatexmath/StyleAtom.java: -------------------------------------------------------------------------------- 1 | /* StyleAtom.java 2 | * ========================================================================= 3 | * This file is part of the JLaTeXMath Library - http://forge.scilab.org/jlatexmath 4 | * 5 | * Copyright (C) 2009 DENIZET Calixte 6 | * 7 | * This program is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or (at 10 | * your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, but 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * General Public License for more details. 16 | * 17 | * A copy of the GNU General Public License can be found in the file 18 | * LICENSE.txt provided with the source distribution of this program (see 19 | * the META-INF directory in the source jar). This license can also be 20 | * found on the GNU website at http://www.gnu.org/licenses/gpl.html. 21 | * 22 | * If you did not receive a copy of the GNU General Public License along 23 | * with this program, contact the lead developer, or write to the Free 24 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 25 | * 02110-1301, USA. 26 | * 27 | */ 28 | 29 | package org.scilab.forge.jlatexmath; 30 | 31 | /** 32 | * An atom representing a modification of style in a formula (e.g. textstyle or displaystyle). 33 | */ 34 | public class StyleAtom extends Atom { 35 | 36 | private int style; 37 | private Atom at; 38 | 39 | public StyleAtom(int style, Atom at) { 40 | this.style = style; 41 | this.at = at; 42 | } 43 | 44 | public Box createBox(TeXEnvironment env) { 45 | int sstyle = env.getStyle(); 46 | env.setStyle(style); 47 | Box box = at.createBox(env); 48 | env.setStyle(sstyle); 49 | return box; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/main/java/org/scilab/forge/jlatexmath/SymbolMappingNotFoundException.java: -------------------------------------------------------------------------------- 1 | /* SymbolMappingNotFoundException.java 2 | * ========================================================================= 3 | * This file is originally part of the JMathTeX Library - http://jmathtex.sourceforge.net 4 | * 5 | * Copyright (C) 2004-2007 Universiteit Gent 6 | * Copyright (C) 2009 DENIZET Calixte 7 | * 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; either version 2 of the License, or (at 11 | * your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, but 14 | * WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * General Public License for more details. 17 | * 18 | * A copy of the GNU General Public License can be found in the file 19 | * LICENSE.txt provided with the source distribution of this program (see 20 | * the META-INF directory in the source jar). This license can also be 21 | * found on the GNU website at http://www.gnu.org/licenses/gpl.html. 22 | * 23 | * If you did not receive a copy of the GNU General Public License along 24 | * with this program, contact the lead developer, or write to the Free 25 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 26 | * 02110-1301, USA. 27 | * 28 | */ 29 | 30 | package org.scilab.forge.jlatexmath; 31 | 32 | /** 33 | * Signals a missing symbol mapping. 34 | * 35 | * @author Kurt Vermeulen 36 | */ 37 | public class SymbolMappingNotFoundException extends JMathTeXException { 38 | 39 | protected SymbolMappingNotFoundException(String symbolName) { 40 | super("No mapping found for the symbol '" + symbolName + "'! " 41 | + "Insert a <" + DefaultTeXFontParser.SYMBOL_MAPPING_EL 42 | + ">-element in '" + DefaultTeXFontParser.RESOURCE_NAME + "'."); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/org/scilab/forge/jlatexmath/SymbolNotFoundException.java: -------------------------------------------------------------------------------- 1 | /* SymbolNotFoundException.java 2 | * ========================================================================= 3 | * This file is originally part of the JMathTeX Library - http://jmathtex.sourceforge.net 4 | * 5 | * Copyright (C) 2004-2007 Universiteit Gent 6 | * Copyright (C) 2009 DENIZET Calixte 7 | * 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; either version 2 of the License, or (at 11 | * your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, but 14 | * WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * General Public License for more details. 17 | * 18 | * A copy of the GNU General Public License can be found in the file 19 | * LICENSE.txt provided with the source distribution of this program (see 20 | * the META-INF directory in the source jar). This license can also be 21 | * found on the GNU website at http://www.gnu.org/licenses/gpl.html. 22 | * 23 | * If you did not receive a copy of the GNU General Public License along 24 | * with this program, contact the lead developer, or write to the Free 25 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 26 | * 02110-1301, USA. 27 | * 28 | */ 29 | 30 | package org.scilab.forge.jlatexmath; 31 | 32 | /** 33 | * Signals that an unknown symbol was used. 34 | * 35 | * @author Kurt Vermeulen 36 | */ 37 | public class SymbolNotFoundException extends JMathTeXException { 38 | 39 | protected SymbolNotFoundException(String name) { 40 | super("There's no symbol with the name '" + name + "' defined in '" 41 | + TeXSymbolParser.RESOURCE_NAME + "'!"); 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/org/scilab/forge/jlatexmath/TextCircledAtom.java: -------------------------------------------------------------------------------- 1 | /* TextCircledAtom.java 2 | * ========================================================================= 3 | * This file is part of the JLaTeXMath Library - http://forge.scilab.org/jlatexmath 4 | * 5 | * Copyright (C) 2009 DENIZET Calixte 6 | * 7 | * This program is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or (at 10 | * your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, but 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * General Public License for more details. 16 | * 17 | * A copy of the GNU General Public License can be found in the file 18 | * LICENSE.txt provided with the source distribution of this program (see 19 | * the META-INF directory in the source jar). This license can also be 20 | * found on the GNU website at http://www.gnu.org/licenses/gpl.html. 21 | * 22 | * If you did not receive a copy of the GNU General Public License along 23 | * with this program, contact the lead developer, or write to the Free 24 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 25 | * 02110-1301, USA. 26 | * 27 | */ 28 | 29 | package org.scilab.forge.jlatexmath; 30 | 31 | /** 32 | * An atom with representing an t with a caron. 33 | */ 34 | public class TextCircledAtom extends Atom { 35 | 36 | private Atom at; 37 | 38 | public TextCircledAtom(Atom at) { 39 | this.at = at; 40 | } 41 | 42 | public Box createBox(TeXEnvironment env) { 43 | Box circle = SymbolAtom.get("bigcirc").createBox(env); 44 | circle.setShift(-0.07f * SpaceAtom.getFactor(TeXConstants.UNIT_EX, env)); 45 | Box box = at.createBox(env); 46 | HorizontalBox hb = new HorizontalBox(box, circle.getWidth(), TeXConstants.ALIGN_CENTER); 47 | hb.add(new StrutBox(-hb.getWidth(), 0, 0, 0)); 48 | hb.add(circle); 49 | return hb; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/main/java/org/scilab/forge/jlatexmath/TextStyleAtom.java: -------------------------------------------------------------------------------- 1 | /* TextStyleAtom.java 2 | * ========================================================================= 3 | * This file is part of the JLaTeXMath Library - http://forge.scilab.org/jlatexmath 4 | * 5 | * Copyright (C) 2009 DENIZET Calixte 6 | * 7 | * This program is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or (at 10 | * your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, but 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * General Public License for more details. 16 | * 17 | * A copy of the GNU General Public License can be found in the file 18 | * LICENSE.txt provided with the source distribution of this program (see 19 | * the META-INF directory in the source jar). This license can also be 20 | * found on the GNU website at http://www.gnu.org/licenses/gpl.html. 21 | * 22 | * If you did not receive a copy of the GNU General Public License along 23 | * with this program, contact the lead developer, or write to the Free 24 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 25 | * 02110-1301, USA. 26 | * 27 | */ 28 | 29 | package org.scilab.forge.jlatexmath; 30 | 31 | /** 32 | * An atom representing a modification of style in a formula (e.g. textstyle or displaystyle). 33 | */ 34 | public class TextStyleAtom extends Atom { 35 | 36 | private String style; 37 | private Atom at; 38 | 39 | public TextStyleAtom(Atom at, String style) { 40 | this.style = style; 41 | this.at = at; 42 | } 43 | 44 | public Box createBox(TeXEnvironment env) { 45 | String prevStyle = env.getTextStyle(); 46 | env.setTextStyle(style); 47 | Box box = at.createBox(env); 48 | env.setTextStyle(prevStyle); 49 | return box; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/main/java/org/scilab/forge/jlatexmath/TextStyleMappingNotFoundException.java: -------------------------------------------------------------------------------- 1 | /* TextStyleMappingNotFoundException.java 2 | * ========================================================================= 3 | * This file is originally part of the JMathTeX Library - http://jmathtex.sourceforge.net 4 | * 5 | * Copyright (C) 2004-2007 Universiteit Gent 6 | * Copyright (C) 2009 DENIZET Calixte 7 | * 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; either version 2 of the License, or (at 11 | * your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, but 14 | * WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * General Public License for more details. 17 | * 18 | * A copy of the GNU General Public License can be found in the file 19 | * LICENSE.txt provided with the source distribution of this program (see 20 | * the META-INF directory in the source jar). This license can also be 21 | * found on the GNU website at http://www.gnu.org/licenses/gpl.html. 22 | * 23 | * If you did not receive a copy of the GNU General Public License along 24 | * with this program, contact the lead developer, or write to the Free 25 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 26 | * 02110-1301, USA. 27 | * 28 | */ 29 | 30 | package org.scilab.forge.jlatexmath; 31 | 32 | /** 33 | * Signals a missing text style mapping. 34 | * 35 | * @author Kurt Vermeulen 36 | */ 37 | public class TextStyleMappingNotFoundException extends JMathTeXException { 38 | 39 | protected TextStyleMappingNotFoundException(String styleName) { 40 | super("No mapping found for the text style '" + styleName + "'! " 41 | + "Insert a <" + DefaultTeXFontParser.STYLE_MAPPING_EL 42 | + ">-element in '" + DefaultTeXFontParser.RESOURCE_NAME + "'."); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/org/scilab/forge/jlatexmath/TtAtom.java: -------------------------------------------------------------------------------- 1 | /* TtAtom.java 2 | * ========================================================================= 3 | * This file is part of the JLaTeXMath Library - http://forge.scilab.org/jlatexmath 4 | * 5 | * Copyright (C) 2009 DENIZET Calixte 6 | * 7 | * This program is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or (at 10 | * your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, but 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * General Public License for more details. 16 | * 17 | * A copy of the GNU General Public License can be found in the file 18 | * LICENSE.txt provided with the source distribution of this program (see 19 | * the META-INF directory in the source jar). This license can also be 20 | * found on the GNU website at http://www.gnu.org/licenses/gpl.html. 21 | * 22 | * If you did not receive a copy of the GNU General Public License along 23 | * with this program, contact the lead developer, or write to the Free 24 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 25 | * 02110-1301, USA. 26 | * 27 | */ 28 | 29 | package org.scilab.forge.jlatexmath; 30 | 31 | /** 32 | * An atom representing a typewriter atom. 33 | */ 34 | public class TtAtom extends Atom { 35 | 36 | private Atom base; 37 | 38 | public TtAtom(Atom base) { 39 | this.base = base; 40 | } 41 | 42 | public Box createBox(TeXEnvironment env) { 43 | env = env.copy(env.getTeXFont().copy()); 44 | env.getTeXFont().setTt(true); 45 | Box box = base.createBox(env); 46 | env.getTeXFont().setTt(false); 47 | return box; 48 | } 49 | 50 | } -------------------------------------------------------------------------------- /src/main/java/org/scilab/forge/jlatexmath/TypedAtom.java: -------------------------------------------------------------------------------- 1 | /* TypedAtom.java 2 | * ========================================================================= 3 | * This file is part of the JLaTeXMath Library - http://forge.scilab.org/jlatexmath 4 | * 5 | * Copyright (C) 2009 DENIZET Calixte 6 | * 7 | * This program is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or (at 10 | * your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, but 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * General Public License for more details. 16 | * 17 | * A copy of the GNU General Public License can be found in the file 18 | * LICENSE.txt provided with the source distribution of this program (see 19 | * the META-INF directory in the source jar). This license can also be 20 | * found on the GNU website at http://www.gnu.org/licenses/gpl.html. 21 | * 22 | * If you did not receive a copy of the GNU General Public License along 23 | * with this program, contact the lead developer, or write to the Free 24 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 25 | * 02110-1301, USA. 26 | * 27 | */ 28 | 29 | package org.scilab.forge.jlatexmath; 30 | 31 | /** 32 | * An atom representing another atom with an overrided lefttype and righttype. This 33 | * affects the glue inserted before and after this atom. 34 | */ 35 | public class TypedAtom extends Atom { 36 | 37 | // new lefttype and righttype 38 | private final int leftType; 39 | private final int rightType; 40 | 41 | // atom for which new types are set 42 | private final Atom atom; 43 | 44 | public TypedAtom(int leftType, int rightType, Atom atom) { 45 | this.leftType = leftType; 46 | this.rightType = rightType; 47 | this.atom = atom; 48 | this.type_limits = atom.type_limits; 49 | } 50 | 51 | public Atom getBase() { 52 | atom.type_limits = type_limits; 53 | return atom; 54 | } 55 | 56 | public Box createBox(TeXEnvironment env) { 57 | return atom.createBox(env); 58 | } 59 | 60 | public int getLeftType() { 61 | return leftType; 62 | } 63 | 64 | public int getRightType() { 65 | return rightType; 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /src/main/java/org/scilab/forge/jlatexmath/UnderlinedAtom.java: -------------------------------------------------------------------------------- 1 | /* UnderlinedAtom.java 2 | * ========================================================================= 3 | * This file is originally part of the JMathTeX Library - http://jmathtex.sourceforge.net 4 | * 5 | * Copyright (C) 2004-2007 Universiteit Gent 6 | * Copyright (C) 2009 DENIZET Calixte 7 | * 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; either version 2 of the License, or (at 11 | * your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, but 14 | * WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * General Public License for more details. 17 | * 18 | * A copy of the GNU General Public License can be found in the file 19 | * LICENSE.txt provided with the source distribution of this program (see 20 | * the META-INF directory in the source jar). This license can also be 21 | * found on the GNU website at http://www.gnu.org/licenses/gpl.html. 22 | * 23 | * If you did not receive a copy of the GNU General Public License along 24 | * with this program, contact the lead developer, or write to the Free 25 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 26 | * 02110-1301, USA. 27 | * 28 | */ 29 | 30 | package org.scilab.forge.jlatexmath; 31 | 32 | /** 33 | * An atom representing another atom with a line under it. 34 | */ 35 | class UnderlinedAtom extends Atom { 36 | 37 | // the base to be underlined 38 | private final Atom base; 39 | 40 | public UnderlinedAtom(Atom f) { 41 | base = f; 42 | type = TeXConstants.TYPE_ORDINARY; // for spacing rules 43 | } 44 | 45 | public Box createBox(TeXEnvironment env) { 46 | double drt = env.getTeXFont().getDefaultRuleThickness(env.getStyle()); 47 | 48 | // create formula box in same style 49 | Box b = (base == null ? new StrutBox(0, 0, 0, 0) : base.createBox(env)); 50 | 51 | // create vertical box 52 | VerticalBox vBox = new VerticalBox(); 53 | vBox.add(b); 54 | vBox.add(new StrutBox(0, 3 * drt, 0, 0)); 55 | vBox.add(new HorizontalRule(drt, b.getWidth(), 0)); 56 | 57 | // baseline vertical box = baseline box b 58 | // there's also an invisible strut of height drt under the rule 59 | vBox.setDepth(b.getDepth() + 5 * drt); 60 | vBox.setHeight(b.getHeight()); 61 | 62 | return vBox; 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /src/main/java/org/scilab/forge/jlatexmath/UnderscoreAtom.java: -------------------------------------------------------------------------------- 1 | /* UnderscoreAtom.java 2 | * ========================================================================= 3 | * This file is part of the JLaTeXMath Library - http://forge.scilab.org/jlatexmath 4 | * 5 | * Copyright (C) 2010 DENIZET Calixte 6 | * 7 | * This program is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or (at 10 | * your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, but 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * General Public License for more details. 16 | * 17 | * A copy of the GNU General Public License can be found in the file 18 | * LICENSE.txt provided with the source distribution of this program (see 19 | * the META-INF directory in the source jar). This license can also be 20 | * found on the GNU website at http://www.gnu.org/licenses/gpl.html. 21 | * 22 | * If you did not receive a copy of the GNU General Public License along 23 | * with this program, contact the lead developer, or write to the Free 24 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 25 | * 02110-1301, USA. 26 | * 27 | */ 28 | 29 | package org.scilab.forge.jlatexmath; 30 | 31 | /** 32 | * An atom representing an underscore. 33 | */ 34 | public class UnderscoreAtom extends Atom { 35 | 36 | public static SpaceAtom w = new SpaceAtom(TeXConstants.UNIT_EM, 0.7f, 0, 0); 37 | public static SpaceAtom s = new SpaceAtom(TeXConstants.UNIT_EM, 0.06f, 0, 0); 38 | 39 | public UnderscoreAtom() { 40 | } 41 | 42 | public Box createBox(TeXEnvironment env) { 43 | double drt = env.getTeXFont().getDefaultRuleThickness(env.getStyle()); 44 | HorizontalBox hb = new HorizontalBox(s.createBox(env)); 45 | hb.add(new HorizontalRule(drt, w.createBox(env).getWidth(), 0)); 46 | return hb; 47 | } 48 | } -------------------------------------------------------------------------------- /src/main/java/org/scilab/forge/jlatexmath/VCenteredAtom.java: -------------------------------------------------------------------------------- 1 | /* VCenteredAtom.java 2 | * ========================================================================= 3 | * This file is originally part of the JMathTeX Library - http://jmathtex.sourceforge.net 4 | * 5 | * Copyright (C) 2004-2007 Universiteit Gent 6 | * Copyright (C) 2009 DENIZET Calixte 7 | * 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; either version 2 of the License, or (at 11 | * your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, but 14 | * WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * General Public License for more details. 17 | * 18 | * A copy of the GNU General Public License can be found in the file 19 | * LICENSE.txt provided with the source distribution of this program (see 20 | * the META-INF directory in the source jar). This license can also be 21 | * found on the GNU website at http://www.gnu.org/licenses/gpl.html. 22 | * 23 | * If you did not receive a copy of the GNU General Public License along 24 | * with this program, contact the lead developer, or write to the Free 25 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 26 | * 02110-1301, USA. 27 | * 28 | */ 29 | 30 | package org.scilab.forge.jlatexmath; 31 | 32 | /** 33 | * An atom representing another atom vertically centered with respect to the axis 34 | * (determined by a general TeXFont parameter) 35 | */ 36 | public class VCenteredAtom extends Atom { 37 | 38 | // atom to be centered vertically with respect to the axis 39 | private final Atom atom; 40 | 41 | public VCenteredAtom(Atom atom) { 42 | this.atom = atom; 43 | } 44 | 45 | public Box createBox(TeXEnvironment env) { 46 | Box b = atom.createBox(env); 47 | 48 | double total = b.getHeight() + b.getDepth(), axis = env.getTeXFont() 49 | .getAxisHeight(env.getStyle()); 50 | 51 | // center on axis 52 | b.setShift(-(total / 2) - axis); 53 | 54 | // put in horizontal box, so shifting will be vertically! 55 | return new HorizontalBox(b); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /src/main/java/org/scilab/forge/jlatexmath/VdotsAtom.java: -------------------------------------------------------------------------------- 1 | /* VdotsAtom.java 2 | * ========================================================================= 3 | * This file is part of the JLaTeXMath Library - http://forge.scilab.org/jlatexmath 4 | * 5 | * Copyright (C) 2009 DENIZET Calixte 6 | * 7 | * This program is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or (at 10 | * your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, but 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * General Public License for more details. 16 | * 17 | * A copy of the GNU General Public License can be found in the file 18 | * LICENSE.txt provided with the source distribution of this program (see 19 | * the META-INF directory in the source jar). This license can also be 20 | * found on the GNU website at http://www.gnu.org/licenses/gpl.html. 21 | * 22 | * If you did not receive a copy of the GNU General Public License along 23 | * with this program, contact the lead developer, or write to the Free 24 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 25 | * 02110-1301, USA. 26 | * 27 | */ 28 | 29 | package org.scilab.forge.jlatexmath; 30 | 31 | /** 32 | * An atom representing vdots. 33 | */ 34 | public class VdotsAtom extends Atom { 35 | 36 | public VdotsAtom() { 37 | } 38 | 39 | public Box createBox(TeXEnvironment env) { 40 | Box dot = SymbolAtom.get("ldotp").createBox(env); 41 | VerticalBox vb = new VerticalBox(dot, 0, TeXConstants.ALIGN_BOTTOM); 42 | Box b = new SpaceAtom(TeXConstants.UNIT_MU, 0, 4, 0).createBox(env); 43 | vb.add(b); 44 | vb.add(dot); 45 | vb.add(b); 46 | vb.add(dot); 47 | double d = vb.getDepth(); 48 | double h = vb.getHeight(); 49 | vb.setDepth(0); 50 | vb.setHeight(d + h); 51 | 52 | return vb; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/main/java/org/scilab/forge/jlatexmath/WebStartAlphabetRegistration.java: -------------------------------------------------------------------------------- 1 | /* WebStartAlphabetRegistration.java 2 | * ========================================================================= 3 | * This file is part of the JLaTeXMath Library - http://forge.scilab.org/jlatexmath 4 | * 5 | * Copyright (C) 2009 DENIZET Calixte 6 | * 7 | * This program is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or (at 10 | * your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, but 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * General Public License for more details. 16 | * 17 | * A copy of the GNU General Public License can be found in the file 18 | * LICENSE.txt provided with the source distribution of this program (see 19 | * the META-INF directory in the source jar). This license can also be 20 | * found on the GNU website at http://www.gnu.org/licenses/gpl.html. 21 | * 22 | * If you did not receive a copy of the GNU General Public License along 23 | * with this program, contact the lead developer, or write to the Free 24 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 25 | * 02110-1301, USA. 26 | * 27 | */ 28 | 29 | package org.scilab.forge.jlatexmath; 30 | 31 | import org.scilab.forge.jlatexmath.cyrillic.CyrillicRegistration; 32 | import org.scilab.forge.jlatexmath.greek.GreekRegistration; 33 | 34 | public class WebStartAlphabetRegistration implements AlphabetRegistration { 35 | 36 | private Character.UnicodeBlock[] blocks; 37 | private AlphabetRegistration reg; 38 | 39 | private WebStartAlphabetRegistration(Character.UnicodeBlock[] blocks) { 40 | this.blocks = blocks; 41 | } 42 | 43 | public static void register(Character.UnicodeBlock[] blocks) { 44 | DefaultTeXFont.registerAlphabet(new WebStartAlphabetRegistration(blocks)); 45 | } 46 | 47 | public Character.UnicodeBlock[] getUnicodeBlock() { 48 | return blocks; 49 | } 50 | 51 | public Object getPackage() throws AlphabetRegistrationException { 52 | if (blocks == JLM_GREEK) { 53 | reg = new GreekRegistration(); 54 | } else if (blocks == JLM_CYRILLIC) { 55 | reg = new CyrillicRegistration(); 56 | } else { 57 | throw new AlphabetRegistrationException("Invalid Unicode Block"); 58 | } 59 | return reg; 60 | } 61 | 62 | public String getTeXFontFileName() { 63 | return reg.getTeXFontFileName(); 64 | } 65 | } -------------------------------------------------------------------------------- /src/main/java/org/scilab/forge/jlatexmath/cyrillic/CyrillicRegistration.java: -------------------------------------------------------------------------------- 1 | /* LaTeXAtom.java 2 | * ========================================================================= 3 | * This file is part of the JLaTeXMath Library - http://forge.scilab.org/jlatexmath 4 | * 5 | * Copyright (C) 2009 DENIZET Calixte 6 | * 7 | * This program is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or (at 10 | * your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, but 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * General Public License for more details. 16 | * 17 | * A copy of the GNU General Public License can be found in the file 18 | * LICENSE.txt provided with the source distribution of this program (see 19 | * the META-INF directory in the source jar). This license can also be 20 | * found on the GNU website at http://www.gnu.org/licenses/gpl.html. 21 | * 22 | * If you did not receive a copy of the GNU General Public License along 23 | * with this program, contact the lead developer, or write to the Free 24 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 25 | * 02110-1301, USA. 26 | * 27 | */ 28 | 29 | package org.scilab.forge.jlatexmath.cyrillic; 30 | 31 | import java.lang.Character.UnicodeBlock; 32 | 33 | import org.scilab.forge.jlatexmath.AlphabetRegistration; 34 | 35 | public class CyrillicRegistration implements AlphabetRegistration { 36 | 37 | public CyrillicRegistration() { 38 | } 39 | 40 | public UnicodeBlock[] getUnicodeBlock() { 41 | return new UnicodeBlock[]{UnicodeBlock.CYRILLIC}; 42 | } 43 | 44 | public Object getPackage() { 45 | return this; 46 | } 47 | 48 | public String getTeXFontFileName() { 49 | return "fonts/language_cyrillic.xml"; 50 | } 51 | } -------------------------------------------------------------------------------- /src/main/java/org/scilab/forge/jlatexmath/dynamic/ExternalConverter.java: -------------------------------------------------------------------------------- 1 | /* ExternalConverter.java 2 | * ========================================================================= 3 | * This file is part of the JLaTeXMath Library - http://forge.scilab.org/jlatexmath 4 | * 5 | * Copyright (C) 2010 DENIZET Calixte 6 | * 7 | * This program is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or (at 10 | * your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, but 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * General Public License for more details. 16 | * 17 | * A copy of the GNU General Public License can be found in the file 18 | * LICENSE.txt provided with the source distribution of this program (see 19 | * the META-INF directory in the source jar). This license can also be 20 | * found on the GNU website at http://www.gnu.org/licenses/gpl.html. 21 | * 22 | * If you did not receive a copy of the GNU General Public License along 23 | * with this program, contact the lead developer, or write to the Free 24 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 25 | * 02110-1301, USA. 26 | * 27 | */ 28 | 29 | package org.scilab.forge.jlatexmath.dynamic; 30 | 31 | public interface ExternalConverter { 32 | 33 | public String getLaTeXString(String externalCode); 34 | 35 | } -------------------------------------------------------------------------------- /src/main/java/org/scilab/forge/jlatexmath/dynamic/ExternalConverterFactory.java: -------------------------------------------------------------------------------- 1 | /* ExternalConverterFactory.java 2 | * ========================================================================= 3 | * This file is part of the JLaTeXMath Library - http://forge.scilab.org/jlatexmath 4 | * 5 | * Copyright (C) 2010 DENIZET Calixte 6 | * 7 | * This program is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or (at 10 | * your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, but 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * General Public License for more details. 16 | * 17 | * A copy of the GNU General Public License can be found in the file 18 | * LICENSE.txt provided with the source distribution of this program (see 19 | * the META-INF directory in the source jar). This license can also be 20 | * found on the GNU website at http://www.gnu.org/licenses/gpl.html. 21 | * 22 | * If you did not receive a copy of the GNU General Public License along 23 | * with this program, contact the lead developer, or write to the Free 24 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 25 | * 02110-1301, USA. 26 | * 27 | */ 28 | 29 | package org.scilab.forge.jlatexmath.dynamic; 30 | 31 | public interface ExternalConverterFactory { 32 | 33 | public ExternalConverter getExternalConverter(); 34 | } -------------------------------------------------------------------------------- /src/main/java/org/scilab/forge/jlatexmath/greek/GreekRegistration.java: -------------------------------------------------------------------------------- 1 | /* GreekRegistration.java 2 | * ========================================================================= 3 | * This file is part of the JLaTeXMath Library - http://forge.scilab.org/jlatexmath 4 | * 5 | * Copyright (C) 2009 DENIZET Calixte 6 | * 7 | * This program is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or (at 10 | * your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, but 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * General Public License for more details. 16 | * 17 | * A copy of the GNU General Public License can be found in the file 18 | * LICENSE.txt provided with the source distribution of this program (see 19 | * the META-INF directory in the source jar). This license can also be 20 | * found on the GNU website at http://www.gnu.org/licenses/gpl.html. 21 | * 22 | * If you did not receive a copy of the GNU General Public License along 23 | * with this program, contact the lead developer, or write to the Free 24 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 25 | * 02110-1301, USA. 26 | * 27 | */ 28 | 29 | package org.scilab.forge.jlatexmath.greek; 30 | 31 | import java.lang.Character.UnicodeBlock; 32 | 33 | import org.scilab.forge.jlatexmath.AlphabetRegistration; 34 | 35 | public class GreekRegistration implements AlphabetRegistration { 36 | 37 | public GreekRegistration() { 38 | } 39 | 40 | public Character.UnicodeBlock[] getUnicodeBlock() { 41 | return new Character.UnicodeBlock[]{Character.UnicodeBlock.GREEK, Character.UnicodeBlock.GREEK_EXTENDED}; 42 | } 43 | 44 | public Object getPackage() { 45 | return this; 46 | } 47 | 48 | public String getTeXFontFileName() { 49 | return "fonts/language_greek.xml"; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/main/java/org/scilab/forge/jlatexmath/greek/LICENSE: -------------------------------------------------------------------------------- 1 | JLaTeXMath Library - Displays LaTeX commands 2 | JLateXMath is an fork of JMathTeX with a lot of modifications to support 3 | many more LaTeX commands, drop of the jdom dependency and easy evolution 4 | capabilities. 5 | 6 | Copyright (C) 2009-2011 DENIZET Calixte 7 | Copyright (C) Kris Coolsaet 8 | Copyright (C) Nico Van Cleemput 9 | Copyright (C) Kurt Vermeulen 10 | Copyright 2004-2007 Universiteit Gent 11 | 12 | 13 | This program is free software; you can redistribute it and/or modify 14 | it under the terms of the GNU General Public License as published by 15 | the Free Software Foundation; either version 2 of the License, or 16 | (at your option) any later version. 17 | 18 | This program is distributed in the hope that it will be useful, 19 | but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | GNU General Public License for more details. 22 | 23 | You should have received a copy of the GNU General Public License 24 | along with this program; see the file COPYING. If not, write to the 25 | Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, 26 | MA 02110-1301, USA. 27 | 28 | 29 | 30 | The archive contains several fonts : 31 | 1) the fonts eufb10.ttf, eufm10.ttf, msam10.ttf and msbm10.ttf are under OFL (Open Font License); 32 | 33 | 2) the font dsrom10.ttf is under a free license; 34 | 35 | 3) the font stmary10.ttf and rsfs10.ttf are in PD (Public Domain); 36 | 37 | 4) the fonts cmbsy10.ttf, cmbx10.ttf, cmbxti10.ttf, cmex10.ttf, cmmi10.ttf, cmr10.ttf, cmss10.ttf, cmssbx10.ttf, cmsy10.ttf and cmtt10.ttf are under Knuth License. 38 | 39 | You can find a copy of these licenses in the fonts directory. 40 | -------------------------------------------------------------------------------- /src/main/java/org/scilab/forge/jlatexmath/greek/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | 2 | Name: org/scilab/forge/jlatexmath/greek/fonts/jlm_fcmbipg.ttf 3 | Content-Type: application/x-font 4 | 5 | Name: org/scilab/forge/jlatexmath/greek/fonts/jlm_fcmbpg.ttf 6 | Content-Type: application/x-font 7 | 8 | Name: org/scilab/forge/jlatexmath/greek/fonts/jlm_fcmripg.ttf 9 | Content-Type: application/x-font 10 | 11 | Name: org/scilab/forge/jlatexmath/greek/fonts/jlm_fcmrpg.ttf 12 | Content-Type: application/x-font 13 | 14 | Name: org/scilab/forge/jlatexmath/greek/fonts/jlm_fcsbpg.ttf 15 | Content-Type: application/x-font 16 | 17 | Name: org/scilab/forge/jlatexmath/greek/fonts/jlm_fcsropg.ttf 18 | Content-Type: application/x-font 19 | 20 | Name: org/scilab/forge/jlatexmath/greek/fonts/jlm_fcsrpg.ttf 21 | Content-Type: application/x-font 22 | 23 | Name: org/scilab/forge/jlatexmath/greek/fonts/jlm_fctrpg.ttf 24 | Content-Type: application/x-font -------------------------------------------------------------------------------- /src/main/java/org/scilab/forge/jlatexmath/tcaronAtom.java: -------------------------------------------------------------------------------- 1 | /* tcaronAtom.java 2 | * ========================================================================= 3 | * This file is part of the JLaTeXMath Library - http://forge.scilab.org/jlatexmath 4 | * 5 | * Copyright (C) 2009 DENIZET Calixte 6 | * 7 | * This program is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or (at 10 | * your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, but 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * General Public License for more details. 16 | * 17 | * A copy of the GNU General Public License can be found in the file 18 | * LICENSE.txt provided with the source distribution of this program (see 19 | * the META-INF directory in the source jar). This license can also be 20 | * found on the GNU website at http://www.gnu.org/licenses/gpl.html. 21 | * 22 | * If you did not receive a copy of the GNU General Public License along 23 | * with this program, contact the lead developer, or write to the Free 24 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 25 | * 02110-1301, USA. 26 | * 27 | */ 28 | 29 | package org.scilab.forge.jlatexmath; 30 | 31 | /** 32 | * An atom with representing an t with a caron. 33 | */ 34 | public class tcaronAtom extends Atom { 35 | 36 | public tcaronAtom() { 37 | } 38 | 39 | public Box createBox(TeXEnvironment env) { 40 | CharBox A = new CharBox(env.getTeXFont().getChar("textapos", env.getStyle())); 41 | CharBox t = new CharBox(env.getTeXFont().getChar('t', "mathnormal", env.getStyle())); 42 | HorizontalBox hb = new HorizontalBox(t); 43 | hb.add(new SpaceAtom(TeXConstants.UNIT_EM, -0.3f, 0, 0).createBox(env)); 44 | hb.add(A); 45 | return hb; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/main/resources/org/scilab/forge/jlatexmath/cyrillic/LICENSE: -------------------------------------------------------------------------------- 1 | JLaTeXMath Library - Displays LaTeX commands 2 | JLateXMath is an fork of JMathTeX with a lot of modifications to support 3 | many more LaTeX commands, drop of the jdom dependency and easy evolution 4 | capabilities. 5 | 6 | Copyright (C) 2009-2011 DENIZET Calixte 7 | Copyright (C) Kris Coolsaet 8 | Copyright (C) Nico Van Cleemput 9 | Copyright (C) Kurt Vermeulen 10 | Copyright 2004-2007 Universiteit Gent 11 | 12 | 13 | This program is free software; you can redistribute it and/or modify 14 | it under the terms of the GNU General Public License as published by 15 | the Free Software Foundation; either version 2 of the License, or 16 | (at your option) any later version. 17 | 18 | This program is distributed in the hope that it will be useful, 19 | but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | GNU General Public License for more details. 22 | 23 | You should have received a copy of the GNU General Public License 24 | along with this program; see the file COPYING. If not, write to the 25 | Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, 26 | MA 02110-1301, USA. 27 | 28 | 29 | 30 | The archive contains several fonts : 31 | 1) the fonts eufb10.ttf, eufm10.ttf, msam10.ttf and msbm10.ttf are under OFL (Open Font License); 32 | 33 | 2) the font dsrom10.ttf is under a free license; 34 | 35 | 3) the font stmary10.ttf and rsfs10.ttf are in PD (Public Domain); 36 | 37 | 4) the fonts cmbsy10.ttf, cmbx10.ttf, cmbxti10.ttf, cmex10.ttf, cmmi10.ttf, cmr10.ttf, cmss10.ttf, cmssbx10.ttf, cmsy10.ttf and cmtt10.ttf are under Knuth License. 38 | 39 | You can find a copy of these licenses in the fonts directory. 40 | -------------------------------------------------------------------------------- /src/main/resources/org/scilab/forge/jlatexmath/cyrillic/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | 2 | Name: org/scilab/forge/jlatexmath/cyrillic/fonts/jlm_wnr10.ttf 3 | Content-Type: application/x-font 4 | 5 | Name: org/scilab/forge/jlatexmath/cyrillic/fonts/jlm_wnti10.ttf 6 | Content-Type: application/x-font 7 | 8 | Name: org/scilab/forge/jlatexmath/cyrillic/fonts/jlm_wntt10.ttf 9 | Content-Type: application/x-font 10 | 11 | Name: org/scilab/forge/jlatexmath/cyrillic/fonts/jlm_wnss10.ttf 12 | Content-Type: application/x-font 13 | 14 | Name: org/scilab/forge/jlatexmath/cyrillic/fonts/jlm_wnssbx10.ttf 15 | Content-Type: application/x-font 16 | 17 | Name: org/scilab/forge/jlatexmath/cyrillic/fonts/jlm_wnssi10.ttf 18 | Content-Type: application/x-font 19 | 20 | Name: org/scilab/forge/jlatexmath/cyrillic/fonts/jlm_wnbx10.ttf 21 | Content-Type: application/x-font 22 | 23 | Name: org/scilab/forge/jlatexmath/cyrillic/fonts/jlm_wnbxti10.ttf 24 | Content-Type: application/x-font -------------------------------------------------------------------------------- /src/main/resources/org/scilab/forge/jlatexmath/cyrillic/fonts/jlm_wnbx10.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bitstormFA/jlatexmathfx/6ecb4d6286e511d0d9758c0868a96ef283c56da6/src/main/resources/org/scilab/forge/jlatexmath/cyrillic/fonts/jlm_wnbx10.ttf -------------------------------------------------------------------------------- /src/main/resources/org/scilab/forge/jlatexmath/cyrillic/fonts/jlm_wnbxti10.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bitstormFA/jlatexmathfx/6ecb4d6286e511d0d9758c0868a96ef283c56da6/src/main/resources/org/scilab/forge/jlatexmath/cyrillic/fonts/jlm_wnbxti10.ttf -------------------------------------------------------------------------------- /src/main/resources/org/scilab/forge/jlatexmath/cyrillic/fonts/jlm_wnr10.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bitstormFA/jlatexmathfx/6ecb4d6286e511d0d9758c0868a96ef283c56da6/src/main/resources/org/scilab/forge/jlatexmath/cyrillic/fonts/jlm_wnr10.ttf -------------------------------------------------------------------------------- /src/main/resources/org/scilab/forge/jlatexmath/cyrillic/fonts/jlm_wnss10.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bitstormFA/jlatexmathfx/6ecb4d6286e511d0d9758c0868a96ef283c56da6/src/main/resources/org/scilab/forge/jlatexmath/cyrillic/fonts/jlm_wnss10.ttf -------------------------------------------------------------------------------- /src/main/resources/org/scilab/forge/jlatexmath/cyrillic/fonts/jlm_wnssbx10.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bitstormFA/jlatexmathfx/6ecb4d6286e511d0d9758c0868a96ef283c56da6/src/main/resources/org/scilab/forge/jlatexmath/cyrillic/fonts/jlm_wnssbx10.ttf -------------------------------------------------------------------------------- /src/main/resources/org/scilab/forge/jlatexmath/cyrillic/fonts/jlm_wnssi10.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bitstormFA/jlatexmathfx/6ecb4d6286e511d0d9758c0868a96ef283c56da6/src/main/resources/org/scilab/forge/jlatexmath/cyrillic/fonts/jlm_wnssi10.ttf -------------------------------------------------------------------------------- /src/main/resources/org/scilab/forge/jlatexmath/cyrillic/fonts/jlm_wnti10.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bitstormFA/jlatexmathfx/6ecb4d6286e511d0d9758c0868a96ef283c56da6/src/main/resources/org/scilab/forge/jlatexmath/cyrillic/fonts/jlm_wnti10.ttf -------------------------------------------------------------------------------- /src/main/resources/org/scilab/forge/jlatexmath/cyrillic/fonts/jlm_wntt10.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bitstormFA/jlatexmathfx/6ecb4d6286e511d0d9758c0868a96ef283c56da6/src/main/resources/org/scilab/forge/jlatexmath/cyrillic/fonts/jlm_wntt10.ttf -------------------------------------------------------------------------------- /src/main/resources/org/scilab/forge/jlatexmath/cyrillic/fonts/language_cyrillic.xml: -------------------------------------------------------------------------------- 1 | 2 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /src/main/resources/org/scilab/forge/jlatexmath/fonts/base/jlm_amsfonts.map.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/main/resources/org/scilab/forge/jlatexmath/fonts/base/jlm_cmex10.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bitstormFA/jlatexmathfx/6ecb4d6286e511d0d9758c0868a96ef283c56da6/src/main/resources/org/scilab/forge/jlatexmath/fonts/base/jlm_cmex10.ttf -------------------------------------------------------------------------------- /src/main/resources/org/scilab/forge/jlatexmath/fonts/base/jlm_cmmi10.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bitstormFA/jlatexmathfx/6ecb4d6286e511d0d9758c0868a96ef283c56da6/src/main/resources/org/scilab/forge/jlatexmath/fonts/base/jlm_cmmi10.ttf -------------------------------------------------------------------------------- /src/main/resources/org/scilab/forge/jlatexmath/fonts/base/jlm_cmmib10.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bitstormFA/jlatexmathfx/6ecb4d6286e511d0d9758c0868a96ef283c56da6/src/main/resources/org/scilab/forge/jlatexmath/fonts/base/jlm_cmmib10.ttf -------------------------------------------------------------------------------- /src/main/resources/org/scilab/forge/jlatexmath/fonts/base/jlm_moustache.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/main/resources/org/scilab/forge/jlatexmath/fonts/euler/jlm_eufb10.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bitstormFA/jlatexmathfx/6ecb4d6286e511d0d9758c0868a96ef283c56da6/src/main/resources/org/scilab/forge/jlatexmath/fonts/euler/jlm_eufb10.ttf -------------------------------------------------------------------------------- /src/main/resources/org/scilab/forge/jlatexmath/fonts/euler/jlm_eufm10.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bitstormFA/jlatexmathfx/6ecb4d6286e511d0d9758c0868a96ef283c56da6/src/main/resources/org/scilab/forge/jlatexmath/fonts/euler/jlm_eufm10.ttf -------------------------------------------------------------------------------- /src/main/resources/org/scilab/forge/jlatexmath/fonts/greek/LICENSE: -------------------------------------------------------------------------------- 1 | JLaTeXMath Library - Displays LaTeX commands 2 | JLateXMath is an fork of JMathTeX with a lot of modifications to support 3 | many more LaTeX commands, drop of the jdom dependency and easy evolution 4 | capabilities. 5 | 6 | Copyright (C) 2009-2011 DENIZET Calixte 7 | Copyright (C) Kris Coolsaet 8 | Copyright (C) Nico Van Cleemput 9 | Copyright (C) Kurt Vermeulen 10 | Copyright 2004-2007 Universiteit Gent 11 | 12 | 13 | This program is free software; you can redistribute it and/or modify 14 | it under the terms of the GNU General Public License as published by 15 | the Free Software Foundation; either version 2 of the License, or 16 | (at your option) any later version. 17 | 18 | This program is distributed in the hope that it will be useful, 19 | but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | GNU General Public License for more details. 22 | 23 | You should have received a copy of the GNU General Public License 24 | along with this program; see the file COPYING. If not, write to the 25 | Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, 26 | MA 02110-1301, USA. 27 | 28 | 29 | 30 | The archive contains several fonts : 31 | 1) the fonts eufb10.ttf, eufm10.ttf, msam10.ttf and msbm10.ttf are under OFL (Open Font License); 32 | 33 | 2) the font dsrom10.ttf is under a free license; 34 | 35 | 3) the font stmary10.ttf and rsfs10.ttf are in PD (Public Domain); 36 | 37 | 4) the fonts cmbsy10.ttf, cmbx10.ttf, cmbxti10.ttf, cmex10.ttf, cmmi10.ttf, cmr10.ttf, cmss10.ttf, cmssbx10.ttf, cmsy10.ttf and cmtt10.ttf are under Knuth License. 38 | 39 | You can find a copy of these licenses in the fonts directory. 40 | -------------------------------------------------------------------------------- /src/main/resources/org/scilab/forge/jlatexmath/fonts/greek/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | 2 | Name: org/scilab/forge/jlatexmath/greek/fonts/jlm_fcmbipg.ttf 3 | Content-Type: application/x-font 4 | 5 | Name: org/scilab/forge/jlatexmath/greek/fonts/jlm_fcmbpg.ttf 6 | Content-Type: application/x-font 7 | 8 | Name: org/scilab/forge/jlatexmath/greek/fonts/jlm_fcmripg.ttf 9 | Content-Type: application/x-font 10 | 11 | Name: org/scilab/forge/jlatexmath/greek/fonts/jlm_fcmrpg.ttf 12 | Content-Type: application/x-font 13 | 14 | Name: org/scilab/forge/jlatexmath/greek/fonts/jlm_fcsbpg.ttf 15 | Content-Type: application/x-font 16 | 17 | Name: org/scilab/forge/jlatexmath/greek/fonts/jlm_fcsropg.ttf 18 | Content-Type: application/x-font 19 | 20 | Name: org/scilab/forge/jlatexmath/greek/fonts/jlm_fcsrpg.ttf 21 | Content-Type: application/x-font 22 | 23 | Name: org/scilab/forge/jlatexmath/greek/fonts/jlm_fctrpg.ttf 24 | Content-Type: application/x-font -------------------------------------------------------------------------------- /src/main/resources/org/scilab/forge/jlatexmath/fonts/greek/fonts/jlm_fcmbipg.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bitstormFA/jlatexmathfx/6ecb4d6286e511d0d9758c0868a96ef283c56da6/src/main/resources/org/scilab/forge/jlatexmath/fonts/greek/fonts/jlm_fcmbipg.ttf -------------------------------------------------------------------------------- /src/main/resources/org/scilab/forge/jlatexmath/fonts/greek/fonts/jlm_fcmbpg.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bitstormFA/jlatexmathfx/6ecb4d6286e511d0d9758c0868a96ef283c56da6/src/main/resources/org/scilab/forge/jlatexmath/fonts/greek/fonts/jlm_fcmbpg.ttf -------------------------------------------------------------------------------- /src/main/resources/org/scilab/forge/jlatexmath/fonts/greek/fonts/jlm_fcmripg.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bitstormFA/jlatexmathfx/6ecb4d6286e511d0d9758c0868a96ef283c56da6/src/main/resources/org/scilab/forge/jlatexmath/fonts/greek/fonts/jlm_fcmripg.ttf -------------------------------------------------------------------------------- /src/main/resources/org/scilab/forge/jlatexmath/fonts/greek/fonts/jlm_fcmrpg.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bitstormFA/jlatexmathfx/6ecb4d6286e511d0d9758c0868a96ef283c56da6/src/main/resources/org/scilab/forge/jlatexmath/fonts/greek/fonts/jlm_fcmrpg.ttf -------------------------------------------------------------------------------- /src/main/resources/org/scilab/forge/jlatexmath/fonts/greek/fonts/jlm_fcsbpg.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bitstormFA/jlatexmathfx/6ecb4d6286e511d0d9758c0868a96ef283c56da6/src/main/resources/org/scilab/forge/jlatexmath/fonts/greek/fonts/jlm_fcsbpg.ttf -------------------------------------------------------------------------------- /src/main/resources/org/scilab/forge/jlatexmath/fonts/greek/fonts/jlm_fcsropg.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bitstormFA/jlatexmathfx/6ecb4d6286e511d0d9758c0868a96ef283c56da6/src/main/resources/org/scilab/forge/jlatexmath/fonts/greek/fonts/jlm_fcsropg.ttf -------------------------------------------------------------------------------- /src/main/resources/org/scilab/forge/jlatexmath/fonts/greek/fonts/jlm_fcsrpg.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bitstormFA/jlatexmathfx/6ecb4d6286e511d0d9758c0868a96ef283c56da6/src/main/resources/org/scilab/forge/jlatexmath/fonts/greek/fonts/jlm_fcsrpg.ttf -------------------------------------------------------------------------------- /src/main/resources/org/scilab/forge/jlatexmath/fonts/greek/fonts/jlm_fctrpg.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bitstormFA/jlatexmathfx/6ecb4d6286e511d0d9758c0868a96ef283c56da6/src/main/resources/org/scilab/forge/jlatexmath/fonts/greek/fonts/jlm_fctrpg.ttf -------------------------------------------------------------------------------- /src/main/resources/org/scilab/forge/jlatexmath/fonts/greek/fonts/language_greek.xml: -------------------------------------------------------------------------------- 1 | 2 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /src/main/resources/org/scilab/forge/jlatexmath/fonts/latin/jlm_cmr10.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bitstormFA/jlatexmathfx/6ecb4d6286e511d0d9758c0868a96ef283c56da6/src/main/resources/org/scilab/forge/jlatexmath/fonts/latin/jlm_cmr10.ttf -------------------------------------------------------------------------------- /src/main/resources/org/scilab/forge/jlatexmath/fonts/latin/jlm_jlmbi10.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bitstormFA/jlatexmathfx/6ecb4d6286e511d0d9758c0868a96ef283c56da6/src/main/resources/org/scilab/forge/jlatexmath/fonts/latin/jlm_jlmbi10.ttf -------------------------------------------------------------------------------- /src/main/resources/org/scilab/forge/jlatexmath/fonts/latin/jlm_jlmbi10.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/main/resources/org/scilab/forge/jlatexmath/fonts/latin/jlm_jlmbx10.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bitstormFA/jlatexmathfx/6ecb4d6286e511d0d9758c0868a96ef283c56da6/src/main/resources/org/scilab/forge/jlatexmath/fonts/latin/jlm_jlmbx10.ttf -------------------------------------------------------------------------------- /src/main/resources/org/scilab/forge/jlatexmath/fonts/latin/jlm_jlmbx10.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/main/resources/org/scilab/forge/jlatexmath/fonts/latin/jlm_jlmi10.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bitstormFA/jlatexmathfx/6ecb4d6286e511d0d9758c0868a96ef283c56da6/src/main/resources/org/scilab/forge/jlatexmath/fonts/latin/jlm_jlmi10.ttf -------------------------------------------------------------------------------- /src/main/resources/org/scilab/forge/jlatexmath/fonts/latin/jlm_jlmi10.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/main/resources/org/scilab/forge/jlatexmath/fonts/latin/jlm_jlmr10.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bitstormFA/jlatexmathfx/6ecb4d6286e511d0d9758c0868a96ef283c56da6/src/main/resources/org/scilab/forge/jlatexmath/fonts/latin/jlm_jlmr10.ttf -------------------------------------------------------------------------------- /src/main/resources/org/scilab/forge/jlatexmath/fonts/latin/jlm_jlmr10.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/main/resources/org/scilab/forge/jlatexmath/fonts/latin/jlm_jlmr10_unchanged.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/main/resources/org/scilab/forge/jlatexmath/fonts/latin/jlm_jlmsb10.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bitstormFA/jlatexmathfx/6ecb4d6286e511d0d9758c0868a96ef283c56da6/src/main/resources/org/scilab/forge/jlatexmath/fonts/latin/jlm_jlmsb10.ttf -------------------------------------------------------------------------------- /src/main/resources/org/scilab/forge/jlatexmath/fonts/latin/jlm_jlmsb10.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/main/resources/org/scilab/forge/jlatexmath/fonts/latin/jlm_jlmsbi10.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bitstormFA/jlatexmathfx/6ecb4d6286e511d0d9758c0868a96ef283c56da6/src/main/resources/org/scilab/forge/jlatexmath/fonts/latin/jlm_jlmsbi10.ttf -------------------------------------------------------------------------------- /src/main/resources/org/scilab/forge/jlatexmath/fonts/latin/jlm_jlmsbi10.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/main/resources/org/scilab/forge/jlatexmath/fonts/latin/jlm_jlmsi10.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bitstormFA/jlatexmathfx/6ecb4d6286e511d0d9758c0868a96ef283c56da6/src/main/resources/org/scilab/forge/jlatexmath/fonts/latin/jlm_jlmsi10.ttf -------------------------------------------------------------------------------- /src/main/resources/org/scilab/forge/jlatexmath/fonts/latin/jlm_jlmsi10.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/main/resources/org/scilab/forge/jlatexmath/fonts/latin/jlm_jlmss10.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bitstormFA/jlatexmathfx/6ecb4d6286e511d0d9758c0868a96ef283c56da6/src/main/resources/org/scilab/forge/jlatexmath/fonts/latin/jlm_jlmss10.ttf -------------------------------------------------------------------------------- /src/main/resources/org/scilab/forge/jlatexmath/fonts/latin/jlm_jlmss10.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/main/resources/org/scilab/forge/jlatexmath/fonts/latin/jlm_jlmtt10.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bitstormFA/jlatexmathfx/6ecb4d6286e511d0d9758c0868a96ef283c56da6/src/main/resources/org/scilab/forge/jlatexmath/fonts/latin/jlm_jlmtt10.ttf -------------------------------------------------------------------------------- /src/main/resources/org/scilab/forge/jlatexmath/fonts/latin/jlm_jlmtt10.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/main/resources/org/scilab/forge/jlatexmath/fonts/latin/optional/jlm_cmbx10.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bitstormFA/jlatexmathfx/6ecb4d6286e511d0d9758c0868a96ef283c56da6/src/main/resources/org/scilab/forge/jlatexmath/fonts/latin/optional/jlm_cmbx10.ttf -------------------------------------------------------------------------------- /src/main/resources/org/scilab/forge/jlatexmath/fonts/latin/optional/jlm_cmbxti10.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bitstormFA/jlatexmathfx/6ecb4d6286e511d0d9758c0868a96ef283c56da6/src/main/resources/org/scilab/forge/jlatexmath/fonts/latin/optional/jlm_cmbxti10.ttf -------------------------------------------------------------------------------- /src/main/resources/org/scilab/forge/jlatexmath/fonts/latin/optional/jlm_cmss10.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bitstormFA/jlatexmathfx/6ecb4d6286e511d0d9758c0868a96ef283c56da6/src/main/resources/org/scilab/forge/jlatexmath/fonts/latin/optional/jlm_cmss10.ttf -------------------------------------------------------------------------------- /src/main/resources/org/scilab/forge/jlatexmath/fonts/latin/optional/jlm_cmssbx10.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bitstormFA/jlatexmathfx/6ecb4d6286e511d0d9758c0868a96ef283c56da6/src/main/resources/org/scilab/forge/jlatexmath/fonts/latin/optional/jlm_cmssbx10.ttf -------------------------------------------------------------------------------- /src/main/resources/org/scilab/forge/jlatexmath/fonts/latin/optional/jlm_cmssi10.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bitstormFA/jlatexmathfx/6ecb4d6286e511d0d9758c0868a96ef283c56da6/src/main/resources/org/scilab/forge/jlatexmath/fonts/latin/optional/jlm_cmssi10.ttf -------------------------------------------------------------------------------- /src/main/resources/org/scilab/forge/jlatexmath/fonts/latin/optional/jlm_cmti10.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bitstormFA/jlatexmathfx/6ecb4d6286e511d0d9758c0868a96ef283c56da6/src/main/resources/org/scilab/forge/jlatexmath/fonts/latin/optional/jlm_cmti10.ttf -------------------------------------------------------------------------------- /src/main/resources/org/scilab/forge/jlatexmath/fonts/latin/optional/jlm_cmti10_unchanged.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/main/resources/org/scilab/forge/jlatexmath/fonts/latin/optional/jlm_cmtt10.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bitstormFA/jlatexmathfx/6ecb4d6286e511d0d9758c0868a96ef283c56da6/src/main/resources/org/scilab/forge/jlatexmath/fonts/latin/optional/jlm_cmtt10.ttf -------------------------------------------------------------------------------- /src/main/resources/org/scilab/forge/jlatexmath/fonts/licences/Knuth_License.txt: -------------------------------------------------------------------------------- 1 | Knuth License 2 | 3 | This software is copyright and you are explicitly granted a license which gives you, the "user" of the software, legal permission to copy, distribute and/or modify the software, so long as if you modify the software then it carry a different name from the original software. 4 | 5 | All the same, please check the specific details of the software's license before making modifications. 6 | -------------------------------------------------------------------------------- /src/main/resources/org/scilab/forge/jlatexmath/fonts/licences/License_for_dsrom.txt: -------------------------------------------------------------------------------- 1 | License 2 | ------- 3 | 4 | You may use and distribute these fonts as you like. 5 | You may modify these fonts as long as you do not 6 | rename the files to one of those names that 7 | Donald E. Knuth chose for the Computer Modern fonts. 8 | (And seriously, who would want to do that?) 9 | -------------------------------------------------------------------------------- /src/main/resources/org/scilab/forge/jlatexmath/fonts/maths/jlm_cmbsy10.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bitstormFA/jlatexmathfx/6ecb4d6286e511d0d9758c0868a96ef283c56da6/src/main/resources/org/scilab/forge/jlatexmath/fonts/maths/jlm_cmbsy10.ttf -------------------------------------------------------------------------------- /src/main/resources/org/scilab/forge/jlatexmath/fonts/maths/jlm_cmsy10.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bitstormFA/jlatexmathfx/6ecb4d6286e511d0d9758c0868a96ef283c56da6/src/main/resources/org/scilab/forge/jlatexmath/fonts/maths/jlm_cmsy10.ttf -------------------------------------------------------------------------------- /src/main/resources/org/scilab/forge/jlatexmath/fonts/maths/jlm_msam10.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bitstormFA/jlatexmathfx/6ecb4d6286e511d0d9758c0868a96ef283c56da6/src/main/resources/org/scilab/forge/jlatexmath/fonts/maths/jlm_msam10.ttf -------------------------------------------------------------------------------- /src/main/resources/org/scilab/forge/jlatexmath/fonts/maths/jlm_msbm10.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bitstormFA/jlatexmathfx/6ecb4d6286e511d0d9758c0868a96ef283c56da6/src/main/resources/org/scilab/forge/jlatexmath/fonts/maths/jlm_msbm10.ttf -------------------------------------------------------------------------------- /src/main/resources/org/scilab/forge/jlatexmath/fonts/maths/jlm_rsfs10.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bitstormFA/jlatexmathfx/6ecb4d6286e511d0d9758c0868a96ef283c56da6/src/main/resources/org/scilab/forge/jlatexmath/fonts/maths/jlm_rsfs10.ttf -------------------------------------------------------------------------------- /src/main/resources/org/scilab/forge/jlatexmath/fonts/maths/jlm_special.map.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/main/resources/org/scilab/forge/jlatexmath/fonts/maths/jlm_special.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bitstormFA/jlatexmathfx/6ecb4d6286e511d0d9758c0868a96ef283c56da6/src/main/resources/org/scilab/forge/jlatexmath/fonts/maths/jlm_special.ttf -------------------------------------------------------------------------------- /src/main/resources/org/scilab/forge/jlatexmath/fonts/maths/jlm_special.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/main/resources/org/scilab/forge/jlatexmath/fonts/maths/jlm_stmary10.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bitstormFA/jlatexmathfx/6ecb4d6286e511d0d9758c0868a96ef283c56da6/src/main/resources/org/scilab/forge/jlatexmath/fonts/maths/jlm_stmary10.ttf -------------------------------------------------------------------------------- /src/main/resources/org/scilab/forge/jlatexmath/fonts/maths/optional/jlm_dsrom10.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bitstormFA/jlatexmathfx/6ecb4d6286e511d0d9758c0868a96ef283c56da6/src/main/resources/org/scilab/forge/jlatexmath/fonts/maths/optional/jlm_dsrom10.ttf -------------------------------------------------------------------------------- /src/main/resources/org/scilab/forge/jlatexmath/fonts/maths/optional/jlm_dsrom10.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/templates/Example1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bitstormFA/jlatexmathfx/6ecb4d6286e511d0d9758c0868a96ef283c56da6/src/templates/Example1.png -------------------------------------------------------------------------------- /src/test/java/com/proudapes/jlatexmathfx/test/NoExceptionOnWrongFormula.java: -------------------------------------------------------------------------------- 1 | package com.proudapes.jlatexmathfx.test; 2 | 3 | import javafx.application.Application; 4 | import javafx.scene.Scene; 5 | import javafx.scene.layout.VBox; 6 | import javafx.stage.Stage; 7 | import com.proudapes.jlatexmathfx.Control.LateXMathControl; 8 | 9 | public class NoExceptionOnWrongFormula extends Application { 10 | @Override 11 | public void start(Stage primaryStage) throws Exception { 12 | String latex = "\\beginError{array}{l}"; 13 | VBox pane=new VBox(); 14 | LateXMathControl lc=new LateXMathControl(latex); 15 | lc.setSize(24); 16 | pane.getChildren().addAll(lc); 17 | 18 | Scene scene=new Scene(pane); 19 | primaryStage.setScene(scene); 20 | primaryStage.setWidth(800); 21 | primaryStage.setHeight(600); 22 | 23 | primaryStage.show(); 24 | 25 | 26 | } 27 | 28 | public static void main(String[] args) { 29 | launch(args); 30 | } 31 | 32 | } 33 | --------------------------------------------------------------------------------