├── .gitignore
├── LICENSE.txt
├── MathKeyboard
├── .gitignore
├── build.gradle
├── proguard-rules.pro
└── src
│ └── main
│ ├── AndroidManifest.xml
│ ├── assets
│ └── iconfont
│ │ ├── iconfont.ttf
│ │ └── iconfont2.ttf
│ ├── java
│ └── com
│ │ └── tianshaokai
│ │ └── mathkeyboard
│ │ ├── KeyboardFragment.java
│ │ ├── manager
│ │ ├── Assembles.java
│ │ ├── ConvertResult.java
│ │ ├── LateXConfig.java
│ │ ├── Latex2View.java
│ │ ├── LatexConstant.java
│ │ ├── MathFormula.java
│ │ ├── MathFormulaFactory.java
│ │ ├── Parser.java
│ │ ├── SelectedStruct.java
│ │ ├── View2Latex.java
│ │ └── ViewAssembleManager.java
│ │ ├── utils
│ │ ├── AFCallback.java
│ │ ├── AFImageGetter.java
│ │ ├── AFTagHandler.java
│ │ ├── BitmapUtil.java
│ │ ├── CallbackBase.java
│ │ ├── DisplayUtils.java
│ │ ├── FileUtil.java
│ │ ├── HtmlUtil.java
│ │ ├── LatexUtil.java
│ │ ├── RichText.java
│ │ ├── RichTextManager.java
│ │ ├── StringUtil.java
│ │ └── UUIDUtil.java
│ │ └── widget
│ │ ├── AbsoluteValueView.java
│ │ ├── AngleView.java
│ │ ├── ArcView.java
│ │ ├── BorderTextView.java
│ │ ├── CustomTextView.java
│ │ ├── EditView.java
│ │ ├── Equation3View.java
│ │ ├── EquationView.java
│ │ ├── FormulaView.java
│ │ ├── FractionView.java
│ │ ├── LineView.java
│ │ ├── MyArcView.java
│ │ ├── Power10View.java
│ │ ├── PowerView.java
│ │ ├── SCTView.java
│ │ ├── SimpleSymbolView.java
│ │ ├── Sqrt2View.java
│ │ ├── SqrtView.java
│ │ ├── SubScriptView.java
│ │ ├── SumView.java
│ │ └── SuperiorView.java
│ └── res
│ ├── anim
│ ├── bottom_view_anim_enter.xml
│ ├── bottom_view_anim_exit.xml
│ ├── update_app_window_in.xml
│ └── update_app_window_out.xml
│ ├── drawable-xxxhdpi
│ ├── icon_sqrt.png
│ └── icon_sum.png
│ ├── drawable
│ ├── btn_latter_keyboard_bg.xml
│ ├── ic_launcher_background.xml
│ ├── selected_tv.xml
│ ├── shape_dotted_stroke.xml
│ ├── textview_bg_normal.xml
│ ├── textview_bg_press.xml
│ ├── textview_normal.xml
│ └── textview_selected.xml
│ ├── layout
│ ├── layout_keyboard_algebra.xml
│ ├── layout_keyboard_default.xml
│ ├── layout_keyboard_geometry.xml
│ ├── layout_keyboard_latter.xml
│ ├── layout_keybord_dialog_fragment.xml
│ ├── layout_latex_absolute_value_1.xml
│ ├── layout_latex_absolute_value_2.xml
│ ├── layout_latex_absolute_value_3.xml
│ ├── layout_latex_angle_1.xml
│ ├── layout_latex_angle_2.xml
│ ├── layout_latex_angle_3.xml
│ ├── layout_latex_arc_1.xml
│ ├── layout_latex_arc_2.xml
│ ├── layout_latex_equation3_1.xml
│ ├── layout_latex_equation3_2.xml
│ ├── layout_latex_equation3_3.xml
│ ├── layout_latex_equation_1.xml
│ ├── layout_latex_equation_2.xml
│ ├── layout_latex_equation_3.xml
│ ├── layout_latex_formula_text.xml
│ ├── layout_latex_fraction_1.xml
│ ├── layout_latex_fraction_2.xml
│ ├── layout_latex_fraction_3.xml
│ ├── layout_latex_line_1.xml
│ ├── layout_latex_line_2.xml
│ ├── layout_latex_line_3.xml
│ ├── layout_latex_power10_1.xml
│ ├── layout_latex_power10_2.xml
│ ├── layout_latex_power10_3.xml
│ ├── layout_latex_power_1.xml
│ ├── layout_latex_power_2.xml
│ ├── layout_latex_power_3.xml
│ ├── layout_latex_power_4.xml
│ ├── layout_latex_sct_1.xml
│ ├── layout_latex_sct_2.xml
│ ├── layout_latex_sct_3.xml
│ ├── layout_latex_sqrt_1.xml
│ ├── layout_latex_sqrt_2.xml
│ ├── layout_latex_sqrt_3.xml
│ ├── layout_latex_sqrt_square_1.xml
│ ├── layout_latex_sqrt_square_2.xml
│ ├── layout_latex_sqrt_square_3.xml
│ ├── layout_latex_subscript_1.xml
│ ├── layout_latex_subscript_2.xml
│ ├── layout_latex_subscript_3.xml
│ ├── layout_latex_sum_1.xml
│ ├── layout_latex_sum_2.xml
│ ├── layout_latex_sum_3.xml
│ ├── layout_latex_superior_1.xml
│ ├── layout_latex_superior_2.xml
│ └── layout_latex_superior_3.xml
│ └── values
│ ├── attrs.xml
│ ├── colors.xml
│ ├── strings.xml
│ └── styles.xml
├── README.md
├── ScreenShot
├── 1.png
├── 2.png
├── 3.png
└── 4.png
├── app
├── .gitignore
├── build.gradle
├── proguard-rules.pro
└── src
│ └── main
│ ├── AndroidManifest.xml
│ ├── java
│ └── com
│ │ └── tianshaokai
│ │ └── app
│ │ └── KeyboardActivity.java
│ └── res
│ ├── drawable-v24
│ └── ic_launcher_foreground.xml
│ ├── layout
│ └── activity_keyboard.xml
│ ├── mipmap-hdpi
│ ├── ic_launcher.png
│ └── ic_launcher_round.png
│ ├── mipmap-mdpi
│ ├── ic_launcher.png
│ └── ic_launcher_round.png
│ ├── mipmap-xhdpi
│ ├── ic_launcher.png
│ └── ic_launcher_round.png
│ ├── mipmap-xxhdpi
│ ├── ic_launcher.png
│ └── ic_launcher_round.png
│ ├── mipmap-xxxhdpi
│ ├── ic_launcher.png
│ └── ic_launcher_round.png
│ └── values
│ ├── colors.xml
│ ├── strings.xml
│ └── styles.xml
├── build.gradle
├── gradle.properties
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── jlatexmath
├── .gitignore
├── build.gradle
├── proguard-rules.pro
└── src
│ └── main
│ ├── AndroidManifest.xml
│ ├── assets
│ ├── DefaultTeXFont.xml
│ ├── GlueSettings.xml
│ ├── TeXFormulaSettings.xml
│ ├── TeXSymbols.xml
│ └── fonts
│ │ ├── base
│ │ ├── jlm_amsfonts.map.xml
│ │ ├── jlm_amssymb.map.xml
│ │ ├── jlm_base.map.xml
│ │ ├── jlm_cmex10.xml
│ │ ├── jlm_cmmi10.xml
│ │ ├── jlm_cmmi10_unchanged.xml
│ │ ├── jlm_cmmib10.xml
│ │ ├── jlm_cmmib10_unchanged.xml
│ │ └── jlm_moustache.xml
│ │ ├── euler
│ │ ├── jlm_eufb10.xml
│ │ └── jlm_eufm10.xml
│ │ ├── jlm_cmbsy10.ttf
│ │ ├── jlm_cmbx10.ttf
│ │ ├── jlm_cmbxti10.ttf
│ │ ├── jlm_cmex10.ttf
│ │ ├── jlm_cmmi10.ttf
│ │ ├── jlm_cmmib10.ttf
│ │ ├── jlm_cmr10.ttf
│ │ ├── jlm_cmss10.ttf
│ │ ├── jlm_cmssbx10.ttf
│ │ ├── jlm_cmssi10.ttf
│ │ ├── jlm_cmsy10.ttf
│ │ ├── jlm_cmti10.ttf
│ │ ├── jlm_cmtt10.ttf
│ │ ├── jlm_cyrillic.map.xml
│ │ ├── jlm_dsrom10.ttf
│ │ ├── jlm_eufb10.ttf
│ │ ├── jlm_eufm10.ttf
│ │ ├── 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
│ │ ├── jlm_jlmbi10.ttf
│ │ ├── jlm_jlmbx10.ttf
│ │ ├── jlm_jlmi10.ttf
│ │ ├── jlm_jlmr10.ttf
│ │ ├── jlm_jlmsb10.ttf
│ │ ├── jlm_jlmsbi10.ttf
│ │ ├── jlm_jlmsi10.ttf
│ │ ├── jlm_jlmss10.ttf
│ │ ├── jlm_jlmtt10.ttf
│ │ ├── jlm_msam10.ttf
│ │ ├── jlm_msbm10.ttf
│ │ ├── jlm_rsfs10.ttf
│ │ ├── jlm_special.ttf
│ │ ├── jlm_stmary10.ttf
│ │ ├── 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
│ │ ├── language_greek.xml
│ │ ├── latin
│ │ ├── jlm_cmr10.xml
│ │ ├── jlm_jlmbi10.xml
│ │ ├── jlm_jlmbx10.xml
│ │ ├── jlm_jlmi10.xml
│ │ ├── jlm_jlmr10.xml
│ │ ├── jlm_jlmr10_unchanged.xml
│ │ ├── jlm_jlmsb10.xml
│ │ ├── jlm_jlmsbi10.xml
│ │ ├── jlm_jlmsi10.xml
│ │ ├── jlm_jlmss10.xml
│ │ ├── 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
│ │ ├── mappings_cyrillic.xml
│ │ ├── mappings_greek.xml
│ │ ├── maths
│ │ ├── jlm_cmbsy10.xml
│ │ ├── jlm_cmsy10.xml
│ │ ├── jlm_msam10.xml
│ │ ├── jlm_msbm10.xml
│ │ ├── jlm_rsfs10.xml
│ │ ├── jlm_special.map.xml
│ │ ├── jlm_special.xml
│ │ ├── jlm_stmary10.xml
│ │ ├── jlm_stmaryrd.map.xml
│ │ └── optional
│ │ │ └── jlm_dsrom10.xml
│ │ ├── symbols_cyrillic.xml
│ │ └── symbols_greek.xml
│ └── java
│ └── com
│ └── tianshaokai
│ └── jlatexmath
│ ├── cache
│ └── JLaTeXMathCache.java
│ ├── core
│ ├── AccentedAtom.java
│ ├── AjLatexMath.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
│ ├── 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
│ ├── Insets.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
│ ├── XArrowAtom.java
│ ├── XLeftRightArrowFactory.java
│ ├── XMLResourceParseException.java
│ └── tcaronAtom.java
│ ├── cyrillic
│ └── CyrillicRegistration.java
│ ├── dynamic
│ ├── DynamicAtom.java
│ ├── ExternalConverter.java
│ └── ExternalConverterFactory.java
│ └── greek
│ └── GreekRegistration.java
└── settings.gradle
/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | .idea
5 | .DS_Store
6 | /build
7 | /captures
8 | .externalNativeBuild
9 |
--------------------------------------------------------------------------------
/MathKeyboard/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/MathKeyboard/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 |
3 | android {
4 | compileSdkVersion 28
5 | defaultConfig {
6 | minSdkVersion 19
7 | targetSdkVersion 28
8 | versionCode 1
9 | versionName "1.0"
10 | }
11 | buildTypes {
12 | release {
13 | minifyEnabled false
14 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
15 | }
16 | }
17 | }
18 |
19 | dependencies {
20 | implementation fileTree(include: ['*.jar'], dir: 'libs')
21 | implementation 'com.android.support:appcompat-v7:28.0.0'
22 | implementation 'io.reactivex.rxjava2:rxandroid:2.1.0'
23 | implementation "io.reactivex.rxjava2:rxjava:2.2.4"
24 | implementation 'com.github.bumptech.glide:glide:4.8.0'
25 | annotationProcessor 'com.github.bumptech.glide:compiler:4.8.0'
26 | implementation 'org.jsoup:jsoup:1.9.2'
27 | implementation project(':jlatexmath')
28 | }
29 |
--------------------------------------------------------------------------------
/MathKeyboard/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
22 |
--------------------------------------------------------------------------------
/MathKeyboard/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
--------------------------------------------------------------------------------
/MathKeyboard/src/main/assets/iconfont/iconfont.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianshaokai/AndroidMathKeyboard/f57eae3481223ba1b2daf10fd8a1f4aac1a8f3d5/MathKeyboard/src/main/assets/iconfont/iconfont.ttf
--------------------------------------------------------------------------------
/MathKeyboard/src/main/assets/iconfont/iconfont2.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianshaokai/AndroidMathKeyboard/f57eae3481223ba1b2daf10fd8a1f4aac1a8f3d5/MathKeyboard/src/main/assets/iconfont/iconfont2.ttf
--------------------------------------------------------------------------------
/MathKeyboard/src/main/java/com/tianshaokai/mathkeyboard/manager/Assembles.java:
--------------------------------------------------------------------------------
1 | package com.tianshaokai.mathkeyboard.manager;
2 |
3 | import android.content.Context;
4 | import android.widget.Toast;
5 |
6 | import com.tianshaokai.mathkeyboard.widget.FormulaView;
7 | import com.tianshaokai.mathkeyboard.widget.SimpleSymbolView;
8 |
9 |
10 | /**
11 | * latex组装器
12 | */
13 |
14 | public class Assembles {
15 | private static Assembles instants;
16 |
17 | public Assembles() {
18 |
19 | }
20 |
21 | public static Assembles getInstants() {
22 | synchronized (Assembles.class) {
23 | if (instants == null) {
24 | instants = new Assembles();
25 | }
26 | }
27 |
28 | return instants;
29 | }
30 |
31 | public FormulaView addMathFormula(Context context, MathFormula mathFormula) {
32 | if (ViewAssembleManager.getInstance().getSelectedViewLevel() > 3) {
33 | Toast.makeText(context, "不能在添加子节点,已经达到最深层次", Toast.LENGTH_SHORT);
34 | return null;
35 | }
36 | SelectedStruct selectedStruct = ViewAssembleManager.getInstance().getSelectedStruct();
37 | FormulaView viewGroup = new MathFormulaFactory().newInstance(context, mathFormula,
38 | ViewAssembleManager.getInstance().getSelectedViewLevel());
39 | ViewAssembleManager.getInstance().addMathFormula(viewGroup, selectedStruct);
40 | return viewGroup;
41 | }
42 |
43 | public SimpleSymbolView addSimpleSymbol(Context context, String content) {
44 | SimpleSymbolView symbolView = new MathFormulaFactory().newInstance(context, content,
45 | ViewAssembleManager.getInstance().getSelectedViewLevelForSymbol());
46 | ViewAssembleManager.getInstance().addSimpleSymbol(symbolView);
47 | return symbolView;
48 | }
49 |
50 | public void deleteMathFormula(Context context) {
51 | ViewAssembleManager.getInstance().deleteMathFormula();
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/MathKeyboard/src/main/java/com/tianshaokai/mathkeyboard/manager/ConvertResult.java:
--------------------------------------------------------------------------------
1 | package com.tianshaokai.mathkeyboard.manager;
2 |
3 | /**
4 | * 转换结果
5 | */
6 |
7 | public class ConvertResult {
8 | public boolean isSuccess = false;
9 | public String message = "";
10 | }
11 |
--------------------------------------------------------------------------------
/MathKeyboard/src/main/java/com/tianshaokai/mathkeyboard/manager/Latex2View.java:
--------------------------------------------------------------------------------
1 | package com.tianshaokai.mathkeyboard.manager;
2 |
3 | /**
4 | * latex转view
5 | */
6 |
7 | public class Latex2View {
8 |
9 | public static MathFormula getFormulaType(String latex) {
10 | if (latex.equals(LatexConstant.Fraction)) {
11 | return MathFormula.Fraction;
12 | } else if (latex.equals(LatexConstant.Sqrt)) {
13 | return MathFormula.Sqrt;
14 | }
15 |
16 | return null;
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/MathKeyboard/src/main/java/com/tianshaokai/mathkeyboard/manager/MathFormula.java:
--------------------------------------------------------------------------------
1 | package com.tianshaokai.mathkeyboard.manager;
2 |
3 | /**
4 | * 数学公式列举
5 | */
6 | public enum MathFormula {
7 | UnKnow, //未知
8 | Fraction, //分数
9 |
10 | Sqrt, //根号
11 | Sqrt2, //根号开平方
12 |
13 | Power, //幂次方
14 | Power2, //二次方
15 | PowerX2, //X的二次方
16 | Power10, //10的幂次方
17 |
18 | Sum, //求和
19 |
20 | Sine, //正弦
21 | Cosine, //余弦
22 | Tangent, //tan
23 |
24 | PIR2, //πr²
25 |
26 | Equation, //方程式
27 | Equation_3, //三项方程式
28 | AbsoluteValue, //绝对值
29 | SubScript, //下标
30 | SubScriptX1, //下标x1
31 | SubScriptX2, //下标x1
32 |
33 | Angle, //三角
34 |
35 | Circ, //度数
36 | Minute, //分
37 | Second, //秒
38 |
39 |
40 | Arc //弧
41 |
42 | }
--------------------------------------------------------------------------------
/MathKeyboard/src/main/java/com/tianshaokai/mathkeyboard/manager/SelectedStruct.java:
--------------------------------------------------------------------------------
1 | package com.tianshaokai.mathkeyboard.manager;
2 |
3 | /**
4 | * 被选中元素,结构体
5 | *
6 | * 可能出现情况:
7 | * 1. latexView, clickView为null,即没有选中元素,则必存在光标,index必不为-1
8 | * 此中情况,只有在光标插入到根节点时出现
9 | * 2. latexView, clickView不为null, 即有选中元素或者非一级光标,分两种情况:
10 | * a. index为-1,则选中的是公式元素
11 | * b. index不为-1,则是插入的光标
12 | */
13 |
14 | public class SelectedStruct {
15 |
16 | //公式名称,被选中元素名称
17 | private String selectedLatexView, selectedClickView;
18 | private boolean isRootSelected = false;
19 | //插入位置,现在光标所在位置
20 | private int index = -1;
21 |
22 | public SelectedStruct() {
23 |
24 | }
25 |
26 |
27 | public String getSelectedLatexView() {
28 | return selectedLatexView;
29 | }
30 |
31 | public void setSelectedLatexView(String selectedLatexView) {
32 | this.selectedLatexView = selectedLatexView;
33 | }
34 |
35 | public String getSelectedClickView() {
36 | return selectedClickView;
37 | }
38 |
39 | public void setSelectedClickView(String selectedClickView) {
40 | this.selectedClickView = selectedClickView;
41 | }
42 |
43 | public int getIndex() {
44 | return index;
45 | }
46 |
47 | public void setIndex(int index) {
48 | this.index = index;
49 | }
50 |
51 | public boolean isRootSelected() {
52 | return isRootSelected;
53 | }
54 |
55 | public void setRootSelected(boolean rootSelected) {
56 | isRootSelected = rootSelected;
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/MathKeyboard/src/main/java/com/tianshaokai/mathkeyboard/manager/View2Latex.java:
--------------------------------------------------------------------------------
1 | package com.tianshaokai.mathkeyboard.manager;
2 |
3 | import com.tianshaokai.mathkeyboard.widget.FormulaView;
4 | import com.tianshaokai.mathkeyboard.widget.FractionView;
5 | import com.tianshaokai.mathkeyboard.widget.Sqrt2View;
6 | import com.tianshaokai.mathkeyboard.widget.SqrtView;
7 |
8 | /**
9 | * view 转 latex
10 | */
11 |
12 | public class View2Latex {
13 |
14 | public static String getLatexName(FormulaView formulaView) {
15 | String className = formulaView.getClass().getSimpleName();
16 | if (className.equals(FractionView.class.getSimpleName())) {
17 | return LatexConstant.Fraction;
18 | } else if (className.equals(SqrtView.class.getSimpleName())) {
19 | return LatexConstant.Sqrt;
20 | } else if (className.equals(Sqrt2View.class.getSimpleName())) {
21 | return LatexConstant.Sqrt;
22 | }
23 |
24 | return null;
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/MathKeyboard/src/main/java/com/tianshaokai/mathkeyboard/utils/AFCallback.java:
--------------------------------------------------------------------------------
1 | package com.tianshaokai.mathkeyboard.utils;
2 |
3 | /**
4 | * 回调基类
5 | */
6 | public interface AFCallback extends CallbackBase {
7 |
8 | void onStart(String uuid);
9 |
10 | void onProcess(int process);
11 | }
12 |
--------------------------------------------------------------------------------
/MathKeyboard/src/main/java/com/tianshaokai/mathkeyboard/utils/CallbackBase.java:
--------------------------------------------------------------------------------
1 | package com.tianshaokai.mathkeyboard.utils;
2 |
3 | public interface CallbackBase {
4 |
5 | void onSuccess(T entity);
6 |
7 | void onFailed(String errMsg);
8 | }
9 |
--------------------------------------------------------------------------------
/MathKeyboard/src/main/java/com/tianshaokai/mathkeyboard/utils/DisplayUtils.java:
--------------------------------------------------------------------------------
1 | package com.tianshaokai.mathkeyboard.utils;
2 |
3 | import android.content.Context;
4 | import android.util.DisplayMetrics;
5 |
6 | public class DisplayUtils {
7 |
8 |
9 | public static DisplayMetrics getDisplayMetrics(Context context) {
10 | return context.getResources().getDisplayMetrics();
11 | }
12 |
13 | public static float getDensity(Context context) {
14 | return getDisplayMetrics(context).density;
15 | }
16 |
17 | public static float getFontDensity(Context context) {
18 | return getDisplayMetrics(context).scaledDensity;
19 | }
20 |
21 |
22 | /**
23 | * 获取屏幕宽度
24 | *
25 | * @return
26 | */
27 | public static int getScreenWidth(Context context) {
28 | return getDisplayMetrics(context).widthPixels;
29 | }
30 |
31 | /**
32 | * 获取屏幕高度
33 | *
34 | * @return
35 | */
36 | public static int getScreenHeight(Context context) {
37 | return getDisplayMetrics(context).heightPixels;
38 | }
39 |
40 | /**
41 | * 单位转换: dp -> px
42 | *
43 | * @param dp
44 | * @return
45 | */
46 | public static int dp2px(Context context, float dp) {
47 | return (int) (getDensity(context) * dp + 0.5);
48 | }
49 |
50 | /**
51 | * 单位转换:px -> dp
52 | *
53 | * @param px
54 | * @return
55 | */
56 | public static int px2dp(Context context, float px) {
57 | return (int) (px / getDensity(context) + 0.5);
58 | }
59 |
60 | /**
61 | * 单位转换: sp -> px
62 | *
63 | * @param sp
64 | * @return
65 | */
66 | public static int sp2px(Context context, float sp) {
67 | return (int) (getFontDensity(context) * sp + 0.5);
68 | }
69 |
70 | /**
71 | * 单位转换:px -> sp
72 | *
73 | * @param px
74 | * @return
75 | */
76 | public static int px2sp(Context context, float px) {
77 | return (int) (px / getFontDensity(context) + 0.5);
78 | }
79 | }
80 |
--------------------------------------------------------------------------------
/MathKeyboard/src/main/java/com/tianshaokai/mathkeyboard/utils/HtmlUtil.java:
--------------------------------------------------------------------------------
1 | package com.tianshaokai.mathkeyboard.utils;
2 |
3 | import org.jsoup.Jsoup;
4 | import org.jsoup.nodes.Attributes;
5 | import org.jsoup.nodes.Document;
6 | import org.jsoup.nodes.Element;
7 | import org.jsoup.select.Elements;
8 |
9 | import java.util.HashMap;
10 | import java.util.Iterator;
11 | import java.util.regex.Matcher;
12 | import java.util.regex.Pattern;
13 |
14 | public class HtmlUtil {
15 | public HtmlUtil() {
16 | }
17 |
18 | public static HashMap getImgWidthHeightByHtmlStr(String htmlStr) {
19 | HashMap hashMap = new HashMap();
20 | Document document = Jsoup.parse(htmlStr);
21 | Elements imgElements = document.select("img");
22 |
23 | Element element;
24 | String widthHeightStr;
25 | for(Iterator var4 = imgElements.iterator(); var4.hasNext(); hashMap.put(element.attr("src"), widthHeightStr)) {
26 | element = (Element)var4.next();
27 | Attributes attributes = element.attributes();
28 | widthHeightStr = "";
29 | if (null != attributes) {
30 | String style = attributes.get("style");
31 | style = style.replaceAll(" ", "");
32 | String reWidth = "width:([0-9]+)";
33 | Pattern p = Pattern.compile(reWidth, 34);
34 | Matcher m = p.matcher(style);
35 | String reHeight;
36 | if (m.find()) {
37 | reHeight = m.group(1);
38 | widthHeightStr = widthHeightStr + reHeight;
39 | }
40 |
41 | reHeight = "height:([0-9]+)";
42 | p = Pattern.compile(reHeight, 34);
43 | m = p.matcher(style);
44 | if (m.find()) {
45 | String height = m.group(1);
46 | widthHeightStr = widthHeightStr + "," + height;
47 | }
48 | }
49 | }
50 |
51 | return hashMap;
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/MathKeyboard/src/main/java/com/tianshaokai/mathkeyboard/utils/StringUtil.java:
--------------------------------------------------------------------------------
1 | package com.tianshaokai.mathkeyboard.utils;
2 |
3 | import java.util.regex.Matcher;
4 | import java.util.regex.Pattern;
5 |
6 | /**
7 | * 字符串相关操作类
8 | */
9 | public class StringUtil {
10 |
11 | /**
12 | * 查找指定字符串在某个字符串中出现的次数
13 | * @param srcText 源字符串
14 | * @param findText 要查找的字符串
15 | * @return 出现的次数
16 | */
17 | public static int appearNumber(String srcText, String findText) {
18 | int count = 0;
19 | Pattern p = Pattern.compile(findText);
20 | Matcher m = p.matcher(srcText);
21 | while (m.find()) {
22 | count++;
23 | }
24 | return count;
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/MathKeyboard/src/main/java/com/tianshaokai/mathkeyboard/utils/UUIDUtil.java:
--------------------------------------------------------------------------------
1 | package com.tianshaokai.mathkeyboard.utils;
2 |
3 | import java.util.UUID;
4 |
5 | public class UUIDUtil {
6 | public UUIDUtil() {
7 | }
8 |
9 | public static String generator() {
10 | UUID uuid = UUID.randomUUID();
11 | String str = uuid.toString();
12 | String result = str.substring(0, 8) + str.substring(9, 13) + str.substring(14, 18) + str.substring(19, 23) + str.substring(24);
13 | return result;
14 | }
15 | }
--------------------------------------------------------------------------------
/MathKeyboard/src/main/java/com/tianshaokai/mathkeyboard/widget/CustomTextView.java:
--------------------------------------------------------------------------------
1 | package com.tianshaokai.mathkeyboard.widget;
2 |
3 | import android.content.Context;
4 | import android.graphics.Typeface;
5 | import android.util.AttributeSet;
6 | import android.util.Log;
7 | import android.widget.TextView;
8 |
9 | public class CustomTextView extends TextView {
10 | private static final String TAG = CustomTextView.class.getSimpleName();
11 | private Typeface iconfont;
12 |
13 | public CustomTextView(Context context) {
14 | super(context);
15 | this.init(context);
16 | }
17 |
18 | public CustomTextView(Context context, AttributeSet attrs) {
19 | super(context, attrs);
20 | this.init(context);
21 | }
22 |
23 | public CustomTextView(Context context, AttributeSet attrs, int defStyleAttr) {
24 | super(context, attrs, defStyleAttr);
25 | this.init(context);
26 | }
27 |
28 | private void init(Context context) {
29 | try {
30 | this.iconfont = Typeface.createFromAsset(context.getAssets(), "iconfont/iconfont.ttf");
31 | } catch (Exception var3) {
32 | Log.e(TAG, " 加载 iconfont 字体文件失败");
33 | }
34 |
35 | this.setTypeface(this.iconfont);
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/MathKeyboard/src/main/java/com/tianshaokai/mathkeyboard/widget/EditView.java:
--------------------------------------------------------------------------------
1 | package com.tianshaokai.mathkeyboard.widget;
2 |
3 | import android.content.Context;
4 | import android.graphics.Color;
5 | import android.support.annotation.Nullable;
6 | import android.util.AttributeSet;
7 | import android.util.Log;
8 |
9 | /**
10 | * 编辑框UI
11 | */
12 |
13 | public class EditView extends FormulaView {
14 | private static final String TAG = "EditView";
15 | public EditView(Context context) {
16 | super(context, 1);
17 | initView();
18 | }
19 |
20 | public EditView(Context context, @Nullable AttributeSet attrs) {
21 | super(context, attrs);
22 | initView();
23 | }
24 |
25 | public EditView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
26 | super(context, attrs, defStyleAttr);
27 | initView();
28 | }
29 |
30 |
31 | private void initView() {
32 | Log.d(TAG, "添加编辑框");
33 | //重新设置latexview名称,用于操作
34 | latexView = getClass().getSimpleName();
35 |
36 | this.setBackgroundColor(Color.parseColor("#dddddd"));
37 | //设置可点击控件,并且初始化选中控件
38 | setCanClickView(this, false, true);
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/MathKeyboard/src/main/java/com/tianshaokai/mathkeyboard/widget/LineView.java:
--------------------------------------------------------------------------------
1 | package com.tianshaokai.mathkeyboard.widget;
2 |
3 | import android.content.Context;
4 | import android.support.annotation.Nullable;
5 | import android.util.AttributeSet;
6 | import android.util.Log;
7 | import android.view.LayoutInflater;
8 |
9 | import com.tianshaokai.mathkeyboard.R;
10 |
11 | /**
12 | * 竖线,在没有任何控件选中情况下显示
13 | */
14 |
15 | public class LineView extends FormulaView {
16 | private static final String TAG = "LineView";
17 | public LineView(Context context, int level) {
18 | super(context, 1);
19 | initView(level);
20 | }
21 |
22 | public LineView(Context context, @Nullable AttributeSet attrs) {
23 | super(context, attrs);
24 | }
25 |
26 | public LineView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
27 | super(context, attrs, defStyleAttr);
28 | }
29 |
30 | /**
31 | * desc: 初始化View
32 | * author: Xubin
33 | * date: 2017/5/11 16:49
34 | * update: 2017/5/11
35 | */
36 | private void initView(int level) {
37 | Log.d(TAG, "添加编辑竖线");
38 | //重新设置latexview名称,用于操作
39 | latexView = getClass().getSimpleName();
40 |
41 | if (level == 1) {
42 | LayoutInflater.from(getContext()).inflate(R.layout.layout_latex_line_1, this);
43 | } else if (level == 2){
44 | LayoutInflater.from(getContext()).inflate(R.layout.layout_latex_line_2, this);
45 | } else {
46 | LayoutInflater.from(getContext()).inflate(R.layout.layout_latex_line_3, this);
47 | }
48 | }
49 |
50 | @Override
51 | public boolean isRootSelected() {
52 | return true;
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/MathKeyboard/src/main/java/com/tianshaokai/mathkeyboard/widget/MyArcView.java:
--------------------------------------------------------------------------------
1 | package com.tianshaokai.mathkeyboard.widget;
2 |
3 | import android.content.Context;
4 | import android.graphics.Canvas;
5 | import android.graphics.Color;
6 | import android.graphics.Paint;
7 | import android.graphics.RectF;
8 | import android.support.annotation.Nullable;
9 | import android.util.AttributeSet;
10 | import android.view.View;
11 |
12 | /**
13 | * Created by xiaopeng on 2018/5/11.
14 | */
15 |
16 | public class MyArcView extends View {
17 | private Paint mPaint;
18 |
19 | public MyArcView(Context context) {
20 | super(context);
21 | init();
22 | }
23 |
24 | public MyArcView(Context context, @Nullable AttributeSet attrs) {
25 | super(context, attrs);
26 | init();
27 | }
28 |
29 | private void init() {
30 | mPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
31 | mPaint.setStyle(Paint.Style.STROKE);
32 | mPaint.setColor(Color.BLACK);
33 | mPaint.setTextSize(12);
34 | mPaint.setStrokeWidth(2);
35 | }
36 |
37 | @Override
38 | protected void onDraw(Canvas canvas) {
39 | super.onDraw(canvas);
40 | RectF rectF = new RectF(0, getHeight() / 3, getWidth(), getHeight());
41 | canvas.drawArc(rectF, -30, -120, false, mPaint);
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/MathKeyboard/src/main/res/anim/bottom_view_anim_enter.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/MathKeyboard/src/main/res/anim/bottom_view_anim_exit.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/MathKeyboard/src/main/res/anim/update_app_window_in.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/MathKeyboard/src/main/res/anim/update_app_window_out.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/MathKeyboard/src/main/res/drawable-xxxhdpi/icon_sqrt.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianshaokai/AndroidMathKeyboard/f57eae3481223ba1b2daf10fd8a1f4aac1a8f3d5/MathKeyboard/src/main/res/drawable-xxxhdpi/icon_sqrt.png
--------------------------------------------------------------------------------
/MathKeyboard/src/main/res/drawable-xxxhdpi/icon_sum.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianshaokai/AndroidMathKeyboard/f57eae3481223ba1b2daf10fd8a1f4aac1a8f3d5/MathKeyboard/src/main/res/drawable-xxxhdpi/icon_sum.png
--------------------------------------------------------------------------------
/MathKeyboard/src/main/res/drawable/selected_tv.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/MathKeyboard/src/main/res/drawable/shape_dotted_stroke.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
9 |
--------------------------------------------------------------------------------
/MathKeyboard/src/main/res/drawable/textview_bg_normal.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/MathKeyboard/src/main/res/drawable/textview_bg_press.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/MathKeyboard/src/main/res/drawable/textview_normal.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/MathKeyboard/src/main/res/drawable/textview_selected.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/MathKeyboard/src/main/res/layout/layout_latex_absolute_value_1.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
14 |
15 |
23 |
24 |
29 |
30 |
31 |
32 |
39 |
40 |
--------------------------------------------------------------------------------
/MathKeyboard/src/main/res/layout/layout_latex_absolute_value_2.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
14 |
15 |
23 |
24 |
29 |
30 |
31 |
32 |
39 |
40 |
--------------------------------------------------------------------------------
/MathKeyboard/src/main/res/layout/layout_latex_absolute_value_3.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
14 |
15 |
23 |
24 |
29 |
30 |
31 |
32 |
39 |
40 |
--------------------------------------------------------------------------------
/MathKeyboard/src/main/res/layout/layout_latex_angle_1.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
17 |
18 |
26 |
27 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/MathKeyboard/src/main/res/layout/layout_latex_angle_2.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
17 |
18 |
26 |
27 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/MathKeyboard/src/main/res/layout/layout_latex_angle_3.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
17 |
18 |
26 |
27 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/MathKeyboard/src/main/res/layout/layout_latex_arc_1.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
13 |
14 |
24 |
25 |
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/MathKeyboard/src/main/res/layout/layout_latex_arc_2.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
13 |
14 |
24 |
25 |
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/MathKeyboard/src/main/res/layout/layout_latex_formula_text.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
12 |
13 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/MathKeyboard/src/main/res/layout/layout_latex_fraction_1.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
18 |
19 |
24 |
25 |
26 |
27 |
33 |
34 |
43 |
44 |
50 |
51 |
52 |
53 |
--------------------------------------------------------------------------------
/MathKeyboard/src/main/res/layout/layout_latex_fraction_2.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
18 |
19 |
24 |
25 |
26 |
27 |
33 |
34 |
43 |
44 |
50 |
51 |
52 |
53 |
--------------------------------------------------------------------------------
/MathKeyboard/src/main/res/layout/layout_latex_fraction_3.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
18 |
19 |
24 |
25 |
26 |
27 |
33 |
34 |
43 |
44 |
50 |
51 |
52 |
53 |
--------------------------------------------------------------------------------
/MathKeyboard/src/main/res/layout/layout_latex_line_1.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
13 |
14 |
--------------------------------------------------------------------------------
/MathKeyboard/src/main/res/layout/layout_latex_line_2.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
13 |
14 |
--------------------------------------------------------------------------------
/MathKeyboard/src/main/res/layout/layout_latex_line_3.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
13 |
14 |
--------------------------------------------------------------------------------
/MathKeyboard/src/main/res/layout/layout_latex_power10_1.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
15 |
16 |
23 |
24 |
25 |
26 |
34 |
35 |
40 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/MathKeyboard/src/main/res/layout/layout_latex_power10_2.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
12 |
13 |
19 |
20 |
27 |
28 |
29 |
30 |
38 |
39 |
44 |
45 |
46 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/MathKeyboard/src/main/res/layout/layout_latex_power10_3.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
12 |
13 |
19 |
20 |
27 |
28 |
29 |
30 |
38 |
39 |
44 |
45 |
46 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/MathKeyboard/src/main/res/layout/layout_latex_power_1.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
16 |
17 |
22 |
23 |
24 |
25 |
34 |
35 |
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/MathKeyboard/src/main/res/layout/layout_latex_power_2.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
16 |
17 |
22 |
23 |
24 |
25 |
34 |
35 |
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/MathKeyboard/src/main/res/layout/layout_latex_power_3.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
16 |
17 |
22 |
23 |
24 |
25 |
34 |
35 |
40 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/MathKeyboard/src/main/res/layout/layout_latex_power_4.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
13 |
14 |
21 |
22 |
27 |
28 |
29 |
30 |
37 |
38 |
46 |
47 |
48 |
49 |
50 |
51 |
--------------------------------------------------------------------------------
/MathKeyboard/src/main/res/layout/layout_latex_sct_1.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
17 |
18 |
26 |
27 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/MathKeyboard/src/main/res/layout/layout_latex_sct_2.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
17 |
18 |
26 |
27 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/MathKeyboard/src/main/res/layout/layout_latex_sct_3.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
17 |
18 |
26 |
27 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/MathKeyboard/src/main/res/layout/layout_latex_sqrt_square_1.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
12 |
13 |
18 |
19 |
28 |
29 |
34 |
35 |
36 |
37 |
44 |
45 |
46 |
47 |
--------------------------------------------------------------------------------
/MathKeyboard/src/main/res/layout/layout_latex_sqrt_square_2.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
12 |
13 |
18 |
19 |
27 |
28 |
33 |
34 |
35 |
36 |
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/MathKeyboard/src/main/res/layout/layout_latex_sqrt_square_3.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
12 |
13 |
18 |
19 |
20 |
21 |
28 |
29 |
34 |
35 |
36 |
37 |
44 |
45 |
46 |
47 |
--------------------------------------------------------------------------------
/MathKeyboard/src/main/res/layout/layout_latex_subscript_1.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
12 |
13 |
20 |
21 |
26 |
27 |
28 |
29 |
38 |
39 |
44 |
45 |
46 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/MathKeyboard/src/main/res/layout/layout_latex_subscript_2.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
12 |
13 |
20 |
21 |
26 |
27 |
28 |
29 |
38 |
39 |
44 |
45 |
46 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/MathKeyboard/src/main/res/layout/layout_latex_subscript_3.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
12 |
13 |
20 |
21 |
26 |
27 |
28 |
29 |
38 |
39 |
44 |
45 |
46 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/MathKeyboard/src/main/res/layout/layout_latex_sum_1.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
16 |
17 |
22 |
23 |
24 |
25 |
31 |
32 |
39 |
40 |
46 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/MathKeyboard/src/main/res/layout/layout_latex_sum_2.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
16 |
17 |
22 |
23 |
24 |
25 |
31 |
32 |
39 |
40 |
46 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/MathKeyboard/src/main/res/layout/layout_latex_sum_3.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
16 |
17 |
22 |
23 |
24 |
25 |
31 |
32 |
39 |
40 |
46 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/MathKeyboard/src/main/res/layout/layout_latex_superior_1.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
16 |
17 |
22 |
23 |
24 |
25 |
35 |
36 |
--------------------------------------------------------------------------------
/MathKeyboard/src/main/res/layout/layout_latex_superior_2.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
16 |
17 |
22 |
23 |
24 |
25 |
35 |
36 |
--------------------------------------------------------------------------------
/MathKeyboard/src/main/res/layout/layout_latex_superior_3.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
16 |
17 |
22 |
23 |
24 |
25 |
35 |
36 |
--------------------------------------------------------------------------------
/MathKeyboard/src/main/res/values/attrs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/MathKeyboard/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #008577
4 | #00574B
5 | #D81B60
6 |
7 | #dbdbdb
8 |
9 | #FFFFFF
10 | #000000
11 |
12 | #ffffff
13 | #e6e6e6
14 |
15 |
--------------------------------------------------------------------------------
/MathKeyboard/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 默认
4 | 代数
5 | 几何
6 | 字母
7 | 关闭
8 |
9 |
--------------------------------------------------------------------------------
/MathKeyboard/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
15 |
16 |
22 |
23 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # 数学公式键盘
2 |
3 | ## 键盘简介
4 | 1. 键盘中包括了代数,几何,字母等数学公式
5 | 2. 数学公式嵌套层级为3层,大于3层无法精准插入其他数据
6 | 3. 点击确认后一键导出对应的Latex数学公式
7 |
8 | ## 项目截图
9 |
10 |
11 |
12 | ## 开源协议
13 |
14 | Licensed under the Apache License, Version 2.0 (the "License");
15 | you may not use this file except in compliance with the License.
16 | You may obtain a copy of the License at
17 |
18 | http://www.apache.org/licenses/LICENSE-2.0
19 |
20 | Unless required by applicable law or agreed to in writing, software
21 | distributed under the License is distributed on an "AS IS" BASIS,
22 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
23 | See the License for the specific language governing permissions and
24 | limitations under the License.
25 |
--------------------------------------------------------------------------------
/ScreenShot/1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianshaokai/AndroidMathKeyboard/f57eae3481223ba1b2daf10fd8a1f4aac1a8f3d5/ScreenShot/1.png
--------------------------------------------------------------------------------
/ScreenShot/2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianshaokai/AndroidMathKeyboard/f57eae3481223ba1b2daf10fd8a1f4aac1a8f3d5/ScreenShot/2.png
--------------------------------------------------------------------------------
/ScreenShot/3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianshaokai/AndroidMathKeyboard/f57eae3481223ba1b2daf10fd8a1f4aac1a8f3d5/ScreenShot/3.png
--------------------------------------------------------------------------------
/ScreenShot/4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianshaokai/AndroidMathKeyboard/f57eae3481223ba1b2daf10fd8a1f4aac1a8f3d5/ScreenShot/4.png
--------------------------------------------------------------------------------
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 28
5 |
6 | long time = System.currentTimeMillis() / 1000;
7 |
8 | defaultConfig {
9 | applicationId "com.tianshaokai.mathkeyboard"
10 | minSdkVersion 19
11 | targetSdkVersion 28
12 | versionCode time.intValue()
13 | versionName "1.0"
14 | }
15 |
16 | buildTypes {
17 | release {
18 | minifyEnabled false
19 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
20 | }
21 | }
22 |
23 | }
24 |
25 | dependencies {
26 | implementation fileTree(include: ['*.jar'], dir: 'libs')
27 | implementation 'com.android.support:appcompat-v7:28.0.0'
28 | implementation project(':MathKeyboard')
29 | }
30 |
--------------------------------------------------------------------------------
/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
22 |
--------------------------------------------------------------------------------
/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
7 |
12 |
13 |
19 |
22 |
25 |
26 |
27 |
28 |
34 |
35 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_keyboard.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
11 |
12 |
18 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianshaokai/AndroidMathKeyboard/f57eae3481223ba1b2daf10fd8a1f4aac1a8f3d5/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianshaokai/AndroidMathKeyboard/f57eae3481223ba1b2daf10fd8a1f4aac1a8f3d5/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianshaokai/AndroidMathKeyboard/f57eae3481223ba1b2daf10fd8a1f4aac1a8f3d5/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianshaokai/AndroidMathKeyboard/f57eae3481223ba1b2daf10fd8a1f4aac1a8f3d5/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianshaokai/AndroidMathKeyboard/f57eae3481223ba1b2daf10fd8a1f4aac1a8f3d5/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianshaokai/AndroidMathKeyboard/f57eae3481223ba1b2daf10fd8a1f4aac1a8f3d5/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianshaokai/AndroidMathKeyboard/f57eae3481223ba1b2daf10fd8a1f4aac1a8f3d5/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianshaokai/AndroidMathKeyboard/f57eae3481223ba1b2daf10fd8a1f4aac1a8f3d5/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianshaokai/AndroidMathKeyboard/f57eae3481223ba1b2daf10fd8a1f4aac1a8f3d5/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianshaokai/AndroidMathKeyboard/f57eae3481223ba1b2daf10fd8a1f4aac1a8f3d5/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #008577
4 | #00574B
5 | #D81B60
6 |
7 | #dbdbdb
8 |
9 | #000000
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | AndroidMathKeyboard
4 |
--------------------------------------------------------------------------------
/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 |
5 | repositories {
6 | google()
7 | jcenter()
8 | }
9 | dependencies {
10 | classpath 'com.android.tools.build:gradle:3.2.1'
11 |
12 |
13 | // NOTE: Do not place your application dependencies here; they belong
14 | // in the individual module build.gradle files
15 | }
16 | }
17 |
18 | allprojects {
19 | repositories {
20 | google()
21 | jcenter()
22 | }
23 | }
24 |
25 | task clean(type: Delete) {
26 | delete rootProject.buildDir
27 | }
28 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 | # IDE (e.g. Android Studio) users:
3 | # Gradle settings configured through the IDE *will override*
4 | # any settings specified in this file.
5 | # For more details on how to configure your build environment visit
6 | # http://www.gradle.org/docs/current/userguide/build_environment.html
7 | # Specifies the JVM arguments used for the daemon process.
8 | # The setting is particularly useful for tweaking memory settings.
9 | org.gradle.jvmargs=-Xmx1536m
10 | # When configured, Gradle will run in incubating parallel mode.
11 | # This option should only be used with decoupled projects. More details, visit
12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
13 | # org.gradle.parallel=true
14 |
15 | android.injected.testOnly=false
16 |
17 |
18 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianshaokai/AndroidMathKeyboard/f57eae3481223ba1b2daf10fd8a1f4aac1a8f3d5/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 |
--------------------------------------------------------------------------------
/jlatexmath/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/jlatexmath/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 |
3 | android {
4 | compileSdkVersion 28
5 |
6 | defaultConfig {
7 | minSdkVersion 19
8 | targetSdkVersion 28
9 | versionCode 1
10 | versionName "1.0"
11 |
12 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
13 |
14 | }
15 | buildTypes {
16 | release {
17 | minifyEnabled false
18 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
19 | }
20 | }
21 | }
22 |
23 |
24 | dependencies {
25 | implementation fileTree(dir: 'libs', include: ['*.jar'])
26 | implementation 'com.android.support:appcompat-v7:28.0.0'
27 | }
28 |
--------------------------------------------------------------------------------
/jlatexmath/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in D:\Android\sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
19 | # Uncomment this to preserve the line number information for
20 | # debugging stack traces.
21 | #-keepattributes SourceFile,LineNumberTable
22 |
23 | # If you keep the line number information, uncomment this to
24 | # hide the original source file name.
25 | #-renamesourcefileattribute SourceFile
26 |
--------------------------------------------------------------------------------
/jlatexmath/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/jlatexmath/src/main/assets/fonts/base/jlm_amsfonts.map.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/jlatexmath/src/main/assets/fonts/base/jlm_moustache.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/jlatexmath/src/main/assets/fonts/jlm_cmbsy10.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianshaokai/AndroidMathKeyboard/f57eae3481223ba1b2daf10fd8a1f4aac1a8f3d5/jlatexmath/src/main/assets/fonts/jlm_cmbsy10.ttf
--------------------------------------------------------------------------------
/jlatexmath/src/main/assets/fonts/jlm_cmbx10.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianshaokai/AndroidMathKeyboard/f57eae3481223ba1b2daf10fd8a1f4aac1a8f3d5/jlatexmath/src/main/assets/fonts/jlm_cmbx10.ttf
--------------------------------------------------------------------------------
/jlatexmath/src/main/assets/fonts/jlm_cmbxti10.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianshaokai/AndroidMathKeyboard/f57eae3481223ba1b2daf10fd8a1f4aac1a8f3d5/jlatexmath/src/main/assets/fonts/jlm_cmbxti10.ttf
--------------------------------------------------------------------------------
/jlatexmath/src/main/assets/fonts/jlm_cmex10.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianshaokai/AndroidMathKeyboard/f57eae3481223ba1b2daf10fd8a1f4aac1a8f3d5/jlatexmath/src/main/assets/fonts/jlm_cmex10.ttf
--------------------------------------------------------------------------------
/jlatexmath/src/main/assets/fonts/jlm_cmmi10.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianshaokai/AndroidMathKeyboard/f57eae3481223ba1b2daf10fd8a1f4aac1a8f3d5/jlatexmath/src/main/assets/fonts/jlm_cmmi10.ttf
--------------------------------------------------------------------------------
/jlatexmath/src/main/assets/fonts/jlm_cmmib10.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianshaokai/AndroidMathKeyboard/f57eae3481223ba1b2daf10fd8a1f4aac1a8f3d5/jlatexmath/src/main/assets/fonts/jlm_cmmib10.ttf
--------------------------------------------------------------------------------
/jlatexmath/src/main/assets/fonts/jlm_cmr10.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianshaokai/AndroidMathKeyboard/f57eae3481223ba1b2daf10fd8a1f4aac1a8f3d5/jlatexmath/src/main/assets/fonts/jlm_cmr10.ttf
--------------------------------------------------------------------------------
/jlatexmath/src/main/assets/fonts/jlm_cmss10.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianshaokai/AndroidMathKeyboard/f57eae3481223ba1b2daf10fd8a1f4aac1a8f3d5/jlatexmath/src/main/assets/fonts/jlm_cmss10.ttf
--------------------------------------------------------------------------------
/jlatexmath/src/main/assets/fonts/jlm_cmssbx10.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianshaokai/AndroidMathKeyboard/f57eae3481223ba1b2daf10fd8a1f4aac1a8f3d5/jlatexmath/src/main/assets/fonts/jlm_cmssbx10.ttf
--------------------------------------------------------------------------------
/jlatexmath/src/main/assets/fonts/jlm_cmssi10.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianshaokai/AndroidMathKeyboard/f57eae3481223ba1b2daf10fd8a1f4aac1a8f3d5/jlatexmath/src/main/assets/fonts/jlm_cmssi10.ttf
--------------------------------------------------------------------------------
/jlatexmath/src/main/assets/fonts/jlm_cmsy10.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianshaokai/AndroidMathKeyboard/f57eae3481223ba1b2daf10fd8a1f4aac1a8f3d5/jlatexmath/src/main/assets/fonts/jlm_cmsy10.ttf
--------------------------------------------------------------------------------
/jlatexmath/src/main/assets/fonts/jlm_cmti10.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianshaokai/AndroidMathKeyboard/f57eae3481223ba1b2daf10fd8a1f4aac1a8f3d5/jlatexmath/src/main/assets/fonts/jlm_cmti10.ttf
--------------------------------------------------------------------------------
/jlatexmath/src/main/assets/fonts/jlm_cmtt10.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianshaokai/AndroidMathKeyboard/f57eae3481223ba1b2daf10fd8a1f4aac1a8f3d5/jlatexmath/src/main/assets/fonts/jlm_cmtt10.ttf
--------------------------------------------------------------------------------
/jlatexmath/src/main/assets/fonts/jlm_dsrom10.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianshaokai/AndroidMathKeyboard/f57eae3481223ba1b2daf10fd8a1f4aac1a8f3d5/jlatexmath/src/main/assets/fonts/jlm_dsrom10.ttf
--------------------------------------------------------------------------------
/jlatexmath/src/main/assets/fonts/jlm_eufb10.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianshaokai/AndroidMathKeyboard/f57eae3481223ba1b2daf10fd8a1f4aac1a8f3d5/jlatexmath/src/main/assets/fonts/jlm_eufb10.ttf
--------------------------------------------------------------------------------
/jlatexmath/src/main/assets/fonts/jlm_eufm10.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianshaokai/AndroidMathKeyboard/f57eae3481223ba1b2daf10fd8a1f4aac1a8f3d5/jlatexmath/src/main/assets/fonts/jlm_eufm10.ttf
--------------------------------------------------------------------------------
/jlatexmath/src/main/assets/fonts/jlm_fcmbipg.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianshaokai/AndroidMathKeyboard/f57eae3481223ba1b2daf10fd8a1f4aac1a8f3d5/jlatexmath/src/main/assets/fonts/jlm_fcmbipg.ttf
--------------------------------------------------------------------------------
/jlatexmath/src/main/assets/fonts/jlm_fcmbpg.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianshaokai/AndroidMathKeyboard/f57eae3481223ba1b2daf10fd8a1f4aac1a8f3d5/jlatexmath/src/main/assets/fonts/jlm_fcmbpg.ttf
--------------------------------------------------------------------------------
/jlatexmath/src/main/assets/fonts/jlm_fcmripg.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianshaokai/AndroidMathKeyboard/f57eae3481223ba1b2daf10fd8a1f4aac1a8f3d5/jlatexmath/src/main/assets/fonts/jlm_fcmripg.ttf
--------------------------------------------------------------------------------
/jlatexmath/src/main/assets/fonts/jlm_fcmrpg.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianshaokai/AndroidMathKeyboard/f57eae3481223ba1b2daf10fd8a1f4aac1a8f3d5/jlatexmath/src/main/assets/fonts/jlm_fcmrpg.ttf
--------------------------------------------------------------------------------
/jlatexmath/src/main/assets/fonts/jlm_fcsbpg.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianshaokai/AndroidMathKeyboard/f57eae3481223ba1b2daf10fd8a1f4aac1a8f3d5/jlatexmath/src/main/assets/fonts/jlm_fcsbpg.ttf
--------------------------------------------------------------------------------
/jlatexmath/src/main/assets/fonts/jlm_fcsropg.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianshaokai/AndroidMathKeyboard/f57eae3481223ba1b2daf10fd8a1f4aac1a8f3d5/jlatexmath/src/main/assets/fonts/jlm_fcsropg.ttf
--------------------------------------------------------------------------------
/jlatexmath/src/main/assets/fonts/jlm_fcsrpg.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianshaokai/AndroidMathKeyboard/f57eae3481223ba1b2daf10fd8a1f4aac1a8f3d5/jlatexmath/src/main/assets/fonts/jlm_fcsrpg.ttf
--------------------------------------------------------------------------------
/jlatexmath/src/main/assets/fonts/jlm_fctrpg.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianshaokai/AndroidMathKeyboard/f57eae3481223ba1b2daf10fd8a1f4aac1a8f3d5/jlatexmath/src/main/assets/fonts/jlm_fctrpg.ttf
--------------------------------------------------------------------------------
/jlatexmath/src/main/assets/fonts/jlm_jlmbi10.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianshaokai/AndroidMathKeyboard/f57eae3481223ba1b2daf10fd8a1f4aac1a8f3d5/jlatexmath/src/main/assets/fonts/jlm_jlmbi10.ttf
--------------------------------------------------------------------------------
/jlatexmath/src/main/assets/fonts/jlm_jlmbx10.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianshaokai/AndroidMathKeyboard/f57eae3481223ba1b2daf10fd8a1f4aac1a8f3d5/jlatexmath/src/main/assets/fonts/jlm_jlmbx10.ttf
--------------------------------------------------------------------------------
/jlatexmath/src/main/assets/fonts/jlm_jlmi10.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianshaokai/AndroidMathKeyboard/f57eae3481223ba1b2daf10fd8a1f4aac1a8f3d5/jlatexmath/src/main/assets/fonts/jlm_jlmi10.ttf
--------------------------------------------------------------------------------
/jlatexmath/src/main/assets/fonts/jlm_jlmr10.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianshaokai/AndroidMathKeyboard/f57eae3481223ba1b2daf10fd8a1f4aac1a8f3d5/jlatexmath/src/main/assets/fonts/jlm_jlmr10.ttf
--------------------------------------------------------------------------------
/jlatexmath/src/main/assets/fonts/jlm_jlmsb10.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianshaokai/AndroidMathKeyboard/f57eae3481223ba1b2daf10fd8a1f4aac1a8f3d5/jlatexmath/src/main/assets/fonts/jlm_jlmsb10.ttf
--------------------------------------------------------------------------------
/jlatexmath/src/main/assets/fonts/jlm_jlmsbi10.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianshaokai/AndroidMathKeyboard/f57eae3481223ba1b2daf10fd8a1f4aac1a8f3d5/jlatexmath/src/main/assets/fonts/jlm_jlmsbi10.ttf
--------------------------------------------------------------------------------
/jlatexmath/src/main/assets/fonts/jlm_jlmsi10.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianshaokai/AndroidMathKeyboard/f57eae3481223ba1b2daf10fd8a1f4aac1a8f3d5/jlatexmath/src/main/assets/fonts/jlm_jlmsi10.ttf
--------------------------------------------------------------------------------
/jlatexmath/src/main/assets/fonts/jlm_jlmss10.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianshaokai/AndroidMathKeyboard/f57eae3481223ba1b2daf10fd8a1f4aac1a8f3d5/jlatexmath/src/main/assets/fonts/jlm_jlmss10.ttf
--------------------------------------------------------------------------------
/jlatexmath/src/main/assets/fonts/jlm_jlmtt10.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianshaokai/AndroidMathKeyboard/f57eae3481223ba1b2daf10fd8a1f4aac1a8f3d5/jlatexmath/src/main/assets/fonts/jlm_jlmtt10.ttf
--------------------------------------------------------------------------------
/jlatexmath/src/main/assets/fonts/jlm_msam10.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianshaokai/AndroidMathKeyboard/f57eae3481223ba1b2daf10fd8a1f4aac1a8f3d5/jlatexmath/src/main/assets/fonts/jlm_msam10.ttf
--------------------------------------------------------------------------------
/jlatexmath/src/main/assets/fonts/jlm_msbm10.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianshaokai/AndroidMathKeyboard/f57eae3481223ba1b2daf10fd8a1f4aac1a8f3d5/jlatexmath/src/main/assets/fonts/jlm_msbm10.ttf
--------------------------------------------------------------------------------
/jlatexmath/src/main/assets/fonts/jlm_rsfs10.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianshaokai/AndroidMathKeyboard/f57eae3481223ba1b2daf10fd8a1f4aac1a8f3d5/jlatexmath/src/main/assets/fonts/jlm_rsfs10.ttf
--------------------------------------------------------------------------------
/jlatexmath/src/main/assets/fonts/jlm_special.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianshaokai/AndroidMathKeyboard/f57eae3481223ba1b2daf10fd8a1f4aac1a8f3d5/jlatexmath/src/main/assets/fonts/jlm_special.ttf
--------------------------------------------------------------------------------
/jlatexmath/src/main/assets/fonts/jlm_stmary10.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianshaokai/AndroidMathKeyboard/f57eae3481223ba1b2daf10fd8a1f4aac1a8f3d5/jlatexmath/src/main/assets/fonts/jlm_stmary10.ttf
--------------------------------------------------------------------------------
/jlatexmath/src/main/assets/fonts/jlm_wnbx10.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianshaokai/AndroidMathKeyboard/f57eae3481223ba1b2daf10fd8a1f4aac1a8f3d5/jlatexmath/src/main/assets/fonts/jlm_wnbx10.ttf
--------------------------------------------------------------------------------
/jlatexmath/src/main/assets/fonts/jlm_wnbxti10.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianshaokai/AndroidMathKeyboard/f57eae3481223ba1b2daf10fd8a1f4aac1a8f3d5/jlatexmath/src/main/assets/fonts/jlm_wnbxti10.ttf
--------------------------------------------------------------------------------
/jlatexmath/src/main/assets/fonts/jlm_wnr10.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianshaokai/AndroidMathKeyboard/f57eae3481223ba1b2daf10fd8a1f4aac1a8f3d5/jlatexmath/src/main/assets/fonts/jlm_wnr10.ttf
--------------------------------------------------------------------------------
/jlatexmath/src/main/assets/fonts/jlm_wnss10.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianshaokai/AndroidMathKeyboard/f57eae3481223ba1b2daf10fd8a1f4aac1a8f3d5/jlatexmath/src/main/assets/fonts/jlm_wnss10.ttf
--------------------------------------------------------------------------------
/jlatexmath/src/main/assets/fonts/jlm_wnssbx10.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianshaokai/AndroidMathKeyboard/f57eae3481223ba1b2daf10fd8a1f4aac1a8f3d5/jlatexmath/src/main/assets/fonts/jlm_wnssbx10.ttf
--------------------------------------------------------------------------------
/jlatexmath/src/main/assets/fonts/jlm_wnssi10.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianshaokai/AndroidMathKeyboard/f57eae3481223ba1b2daf10fd8a1f4aac1a8f3d5/jlatexmath/src/main/assets/fonts/jlm_wnssi10.ttf
--------------------------------------------------------------------------------
/jlatexmath/src/main/assets/fonts/jlm_wnti10.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianshaokai/AndroidMathKeyboard/f57eae3481223ba1b2daf10fd8a1f4aac1a8f3d5/jlatexmath/src/main/assets/fonts/jlm_wnti10.ttf
--------------------------------------------------------------------------------
/jlatexmath/src/main/assets/fonts/jlm_wntt10.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianshaokai/AndroidMathKeyboard/f57eae3481223ba1b2daf10fd8a1f4aac1a8f3d5/jlatexmath/src/main/assets/fonts/jlm_wntt10.ttf
--------------------------------------------------------------------------------
/jlatexmath/src/main/assets/fonts/latin/jlm_jlmbi10.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/jlatexmath/src/main/assets/fonts/latin/jlm_jlmbx10.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/jlatexmath/src/main/assets/fonts/latin/jlm_jlmi10.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/jlatexmath/src/main/assets/fonts/latin/jlm_jlmr10.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/jlatexmath/src/main/assets/fonts/latin/jlm_jlmr10_unchanged.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/jlatexmath/src/main/assets/fonts/latin/jlm_jlmsb10.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/jlatexmath/src/main/assets/fonts/latin/jlm_jlmsbi10.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/jlatexmath/src/main/assets/fonts/latin/jlm_jlmsi10.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/jlatexmath/src/main/assets/fonts/latin/jlm_jlmss10.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/jlatexmath/src/main/assets/fonts/latin/jlm_jlmtt10.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/jlatexmath/src/main/assets/fonts/latin/optional/jlm_cmbx10.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianshaokai/AndroidMathKeyboard/f57eae3481223ba1b2daf10fd8a1f4aac1a8f3d5/jlatexmath/src/main/assets/fonts/latin/optional/jlm_cmbx10.ttf
--------------------------------------------------------------------------------
/jlatexmath/src/main/assets/fonts/latin/optional/jlm_cmbxti10.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianshaokai/AndroidMathKeyboard/f57eae3481223ba1b2daf10fd8a1f4aac1a8f3d5/jlatexmath/src/main/assets/fonts/latin/optional/jlm_cmbxti10.ttf
--------------------------------------------------------------------------------
/jlatexmath/src/main/assets/fonts/latin/optional/jlm_cmss10.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianshaokai/AndroidMathKeyboard/f57eae3481223ba1b2daf10fd8a1f4aac1a8f3d5/jlatexmath/src/main/assets/fonts/latin/optional/jlm_cmss10.ttf
--------------------------------------------------------------------------------
/jlatexmath/src/main/assets/fonts/latin/optional/jlm_cmssbx10.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianshaokai/AndroidMathKeyboard/f57eae3481223ba1b2daf10fd8a1f4aac1a8f3d5/jlatexmath/src/main/assets/fonts/latin/optional/jlm_cmssbx10.ttf
--------------------------------------------------------------------------------
/jlatexmath/src/main/assets/fonts/latin/optional/jlm_cmssi10.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianshaokai/AndroidMathKeyboard/f57eae3481223ba1b2daf10fd8a1f4aac1a8f3d5/jlatexmath/src/main/assets/fonts/latin/optional/jlm_cmssi10.ttf
--------------------------------------------------------------------------------
/jlatexmath/src/main/assets/fonts/latin/optional/jlm_cmti10.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianshaokai/AndroidMathKeyboard/f57eae3481223ba1b2daf10fd8a1f4aac1a8f3d5/jlatexmath/src/main/assets/fonts/latin/optional/jlm_cmti10.ttf
--------------------------------------------------------------------------------
/jlatexmath/src/main/assets/fonts/latin/optional/jlm_cmti10_unchanged.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/jlatexmath/src/main/assets/fonts/latin/optional/jlm_cmtt10.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianshaokai/AndroidMathKeyboard/f57eae3481223ba1b2daf10fd8a1f4aac1a8f3d5/jlatexmath/src/main/assets/fonts/latin/optional/jlm_cmtt10.ttf
--------------------------------------------------------------------------------
/jlatexmath/src/main/assets/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 |
--------------------------------------------------------------------------------
/jlatexmath/src/main/assets/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 |
--------------------------------------------------------------------------------
/jlatexmath/src/main/assets/fonts/maths/jlm_special.map.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/jlatexmath/src/main/assets/fonts/maths/jlm_special.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/jlatexmath/src/main/java/com/tianshaokai/jlatexmath/core/AjLatexMath.java:
--------------------------------------------------------------------------------
1 | package com.tianshaokai.jlatexmath.core;
2 |
3 | import android.content.Context;
4 | import android.content.res.AssetManager;
5 | import android.graphics.Color;
6 | import android.graphics.Paint;
7 | import android.graphics.Paint.Style;
8 |
9 | public class AjLatexMath {
10 |
11 | private static Context mContext;
12 | private static Paint st;
13 |
14 | /**
15 | * 初始化画笔以及公式解析类
16 | *
17 | * @param context
18 | */
19 | public static void init(Context context) {
20 | mContext = context;
21 | st = new Paint();
22 | st.setStyle(Style.FILL_AND_STROKE);
23 | st.setColor(Color.BLACK);
24 | st.setStrokeWidth(0);
25 | TeXFormula.getPartialTeXFormula("{x^{2}+ x-1= 0 }").setDEBUG(false);
26 | }
27 |
28 | public static AssetManager getAssetManager() {
29 | AssetManager mng = mContext.getAssets();
30 | return mng;
31 | }
32 |
33 | /**
34 | * 同步画笔颜色,使生成图片与文字夜色一致
35 | *
36 | * @param color
37 | */
38 | public static void setColor(int color) {
39 | if (st == null) {
40 | init(mContext);
41 | }
42 | st.setColor(color);
43 | }
44 |
45 | public static Context getContext() {
46 | return mContext;
47 | }
48 |
49 | public static Paint getPaint() {
50 | return st;
51 | }
52 |
53 | public static float getLeading(float textSize) {
54 | st.setTextSize(textSize);
55 | return st.getFontSpacing();
56 | }
57 |
58 | }
59 |
--------------------------------------------------------------------------------
/jlatexmath/src/main/java/com/tianshaokai/jlatexmath/core/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 com.tianshaokai.jlatexmath.core;
30 |
31 | public interface AlphabetRegistration {
32 |
33 | public static final Character.UnicodeBlock[] JLM_GREEK = new Character.UnicodeBlock[] {
34 | Character.UnicodeBlock.GREEK, Character.UnicodeBlock.GREEK_EXTENDED };
35 | public static final Character.UnicodeBlock[] JLM_CYRILLIC = new Character.UnicodeBlock[] { Character.UnicodeBlock.CYRILLIC };
36 |
37 | public Character.UnicodeBlock[] getUnicodeBlock();
38 |
39 | public Object getPackage() throws AlphabetRegistrationException;
40 |
41 | public String getTeXFontFileName();
42 | }
--------------------------------------------------------------------------------
/jlatexmath/src/main/java/com/tianshaokai/jlatexmath/core/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 com.tianshaokai.jlatexmath.core;
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 | }
--------------------------------------------------------------------------------
/jlatexmath/src/main/java/com/tianshaokai/jlatexmath/core/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 com.tianshaokai.jlatexmath.core;
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 |
--------------------------------------------------------------------------------
/jlatexmath/src/main/java/com/tianshaokai/jlatexmath/core/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 com.tianshaokai.jlatexmath.core;
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 |
--------------------------------------------------------------------------------
/jlatexmath/src/main/java/com/tianshaokai/jlatexmath/core/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 com.tianshaokai.jlatexmath.core;
31 |
32 | /**
33 | * Represents a specific character in a specific font (identified by its font
34 | * ID).
35 | */
36 | public class CharFont {
37 |
38 | public char c;
39 | public int fontId;
40 | public int boldFontId;
41 |
42 | public CharFont(char ch, int f) {
43 | this(ch, f, f);
44 | }
45 |
46 | public CharFont(char ch, int f, int bf) {
47 | c = ch;
48 | fontId = f;
49 | boldFontId = bf;
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/jlatexmath/src/main/java/com/tianshaokai/jlatexmath/core/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 com.tianshaokai.jlatexmath.core;
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 |
--------------------------------------------------------------------------------
/jlatexmath/src/main/java/com/tianshaokai/jlatexmath/core/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 com.tianshaokai.jlatexmath.core;
31 |
32 | public class EmptyFormulaException extends Exception {
33 |
34 | public EmptyFormulaException() {
35 | super("Illegal operation with an empty Formula!");
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/jlatexmath/src/main/java/com/tianshaokai/jlatexmath/core/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 com.tianshaokai.jlatexmath.core;
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 |
--------------------------------------------------------------------------------
/jlatexmath/src/main/java/com/tianshaokai/jlatexmath/core/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 com.tianshaokai.jlatexmath.core;
31 |
32 | public class FontAlreadyLoadedException extends XMLResourceParseException {
33 |
34 | public FontAlreadyLoadedException(String msg) {
35 | super(msg);
36 | }
37 | }
--------------------------------------------------------------------------------
/jlatexmath/src/main/java/com/tianshaokai/jlatexmath/core/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 com.tianshaokai.jlatexmath.core;
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 |
--------------------------------------------------------------------------------
/jlatexmath/src/main/java/com/tianshaokai/jlatexmath/core/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 com.tianshaokai.jlatexmath.core;
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',
46 | env.getStyle()));
47 | return new GeoGebraLogoBox(o.width, o.height);
48 | }
49 | }
--------------------------------------------------------------------------------
/jlatexmath/src/main/java/com/tianshaokai/jlatexmath/core/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 com.tianshaokai.jlatexmath.core;
31 |
32 | import android.graphics.Canvas;
33 |
34 | /**
35 | * A box representing glue.
36 | */
37 | public class GlueBox extends Box {
38 |
39 | protected float stretch = 0, shrink = 0;
40 |
41 | public GlueBox(float space, float stretch, float shrink) {
42 | this.width = space;
43 | this.stretch = stretch;
44 | this.shrink = shrink;
45 | }
46 |
47 | public void draw(Canvas g2, float x, float y) {
48 | // no visible effect
49 | }
50 |
51 | public int getLastFontId() {
52 | return TeXFont.NO_FONT;
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/jlatexmath/src/main/java/com/tianshaokai/jlatexmath/core/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 com.tianshaokai.jlatexmath.core;
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 |
--------------------------------------------------------------------------------
/jlatexmath/src/main/java/com/tianshaokai/jlatexmath/core/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 com.tianshaokai.jlatexmath.core;
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 |
--------------------------------------------------------------------------------
/jlatexmath/src/main/java/com/tianshaokai/jlatexmath/core/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 com.tianshaokai.jlatexmath.core;
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 |
--------------------------------------------------------------------------------
/jlatexmath/src/main/java/com/tianshaokai/jlatexmath/core/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 com.tianshaokai.jlatexmath.core;
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 |
--------------------------------------------------------------------------------
/jlatexmath/src/main/java/com/tianshaokai/jlatexmath/core/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 com.tianshaokai.jlatexmath.core;
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 |
--------------------------------------------------------------------------------
/jlatexmath/src/main/java/com/tianshaokai/jlatexmath/core/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 com.tianshaokai.jlatexmath.core;
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 |
--------------------------------------------------------------------------------
/jlatexmath/src/main/java/com/tianshaokai/jlatexmath/core/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 com.tianshaokai.jlatexmath.core;
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 | }
--------------------------------------------------------------------------------
/jlatexmath/src/main/java/com/tianshaokai/jlatexmath/core/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 com.tianshaokai.jlatexmath.core;
31 |
32 | /**
33 | * Superclass of all the possible (public) exceptions that can be thrown in this
34 | * package.
35 | *
36 | * @author Kurt Vermeulen
37 | */
38 | public class JMathTeXException extends RuntimeException {
39 |
40 | protected JMathTeXException(String msg) {
41 | super(msg);
42 | }
43 |
44 | protected JMathTeXException(String msg, Throwable cause) {
45 | super(msg, cause);
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/jlatexmath/src/main/java/com/tianshaokai/jlatexmath/core/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 com.tianshaokai.jlatexmath.core;
30 |
31 | /**
32 | * An atom representing a middle atom which must be rounded by a left and right
33 | * delimiter.
34 | */
35 | public class MiddleAtom extends Atom {
36 |
37 | public Atom base;
38 | public Box box = new StrutBox(0, 0, 0, 0);
39 |
40 | public MiddleAtom(Atom at) {
41 | base = at;
42 | }
43 |
44 | public Box createBox(TeXEnvironment env) {
45 | return box;
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/jlatexmath/src/main/java/com/tianshaokai/jlatexmath/core/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 com.tianshaokai.jlatexmath.core;
30 |
31 | /**
32 | * An atom representing a mono scale Atom.
33 | */
34 | public class MonoScaleAtom extends ScaleAtom {
35 |
36 | private float factor;
37 |
38 | public MonoScaleAtom(Atom base, float 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 | float f = env.getScaleFactor();
46 | env.setScaleFactor(factor);
47 | return new ScaleBox(base.createBox(env), factor / f);
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/jlatexmath/src/main/java/com/tianshaokai/jlatexmath/core/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 com.tianshaokai.jlatexmath.core;
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 |
--------------------------------------------------------------------------------
/jlatexmath/src/main/java/com/tianshaokai/jlatexmath/core/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 com.tianshaokai.jlatexmath.core;
31 |
32 | /**
33 | * A box representing another box with a horizontal rule above it, with
34 | * appropriate kerning.
35 | */
36 | public class OverBar extends VerticalBox {
37 |
38 | public OverBar(Box b, float kern, float 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 |
--------------------------------------------------------------------------------
/jlatexmath/src/main/java/com/tianshaokai/jlatexmath/core/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 com.tianshaokai.jlatexmath.core;
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 |
--------------------------------------------------------------------------------
/jlatexmath/src/main/java/com/tianshaokai/jlatexmath/core/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 com.tianshaokai.jlatexmath.core;
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 |
--------------------------------------------------------------------------------
/jlatexmath/src/main/java/com/tianshaokai/jlatexmath/core/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 com.tianshaokai.jlatexmath.core;
31 |
32 | /**
33 | * Signals that an error occurred while loading the necessary resources into
34 | * memory.
35 | */
36 | public class ResourceParseException extends JMathTeXException {
37 |
38 | protected ResourceParseException(String msg) {
39 | super(msg);
40 | }
41 |
42 | protected ResourceParseException(String msg, Throwable cause) {
43 | super(msg, cause);
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/jlatexmath/src/main/java/com/tianshaokai/jlatexmath/core/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 com.tianshaokai.jlatexmath.core;
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 |
--------------------------------------------------------------------------------
/jlatexmath/src/main/java/com/tianshaokai/jlatexmath/core/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 com.tianshaokai.jlatexmath.core;
30 |
31 | /**
32 | * An atom representing a boxed base atom.
33 | */
34 | public class ShadowAtom extends FBoxAtom {
35 |
36 | public ShadowAtom(Atom base) {
37 | super(base);
38 | }
39 |
40 | public Box createBox(TeXEnvironment env) {
41 | return new ShadowBox((FramedBox) super.createBox(env), env.getTeXFont()
42 | .getDefaultRuleThickness(env.getStyle()) * 4);
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/jlatexmath/src/main/java/com/tianshaokai/jlatexmath/core/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 com.tianshaokai.jlatexmath.core;
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 |
--------------------------------------------------------------------------------
/jlatexmath/src/main/java/com/tianshaokai/jlatexmath/core/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 com.tianshaokai.jlatexmath.core;
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 |
--------------------------------------------------------------------------------
/jlatexmath/src/main/java/com/tianshaokai/jlatexmath/core/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 com.tianshaokai.jlatexmath.core;
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 | }
--------------------------------------------------------------------------------
/jlatexmath/src/main/java/com/tianshaokai/jlatexmath/core/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 com.tianshaokai.jlatexmath.core;
31 |
32 | import android.graphics.Canvas;
33 |
34 | /**
35 | * A box representing whitespace.
36 | */
37 | public class StrutBox extends Box {
38 |
39 | public StrutBox(float w, float h, float d, float s) {
40 | width = w;
41 | height = h;
42 | depth = d;
43 | shift = s;
44 | }
45 |
46 | public void draw(Canvas g2, float x, float y) {
47 | // no visual effect
48 | }
49 |
50 | public int getLastFontId() {
51 | return TeXFont.NO_FONT;
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/jlatexmath/src/main/java/com/tianshaokai/jlatexmath/core/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 com.tianshaokai.jlatexmath.core;
30 |
31 | /**
32 | * An atom representing a modification of style in a formula (e.g. textstyle or
33 | * displaystyle).
34 | */
35 | public class StyleAtom extends Atom {
36 |
37 | private int style;
38 | private Atom at;
39 |
40 | public StyleAtom(int style, Atom at) {
41 | this.style = style;
42 | this.at = at;
43 | }
44 |
45 | public Box createBox(TeXEnvironment env) {
46 | int sstyle = env.getStyle();
47 | env.setStyle(style);
48 | Box box = at.createBox(env);
49 | env.setStyle(sstyle);
50 | return box;
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/jlatexmath/src/main/java/com/tianshaokai/jlatexmath/core/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 com.tianshaokai.jlatexmath.core;
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 |
--------------------------------------------------------------------------------
/jlatexmath/src/main/java/com/tianshaokai/jlatexmath/core/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 com.tianshaokai.jlatexmath.core;
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 |
--------------------------------------------------------------------------------
/jlatexmath/src/main/java/com/tianshaokai/jlatexmath/core/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 com.tianshaokai.jlatexmath.core;
30 |
31 | /**
32 | * An atom representing a modification of style in a formula (e.g. textstyle or
33 | * displaystyle).
34 | */
35 | public class TextStyleAtom extends Atom {
36 |
37 | private String style;
38 | private Atom at;
39 |
40 | public TextStyleAtom(Atom at, String style) {
41 | this.style = style;
42 | this.at = at;
43 | }
44 |
45 | public Box createBox(TeXEnvironment env) {
46 | String prevStyle = env.getTextStyle();
47 | env.setTextStyle(style);
48 | Box box = at.createBox(env);
49 | env.setTextStyle(prevStyle);
50 | return box;
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/jlatexmath/src/main/java/com/tianshaokai/jlatexmath/core/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 com.tianshaokai.jlatexmath.core;
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 |
--------------------------------------------------------------------------------
/jlatexmath/src/main/java/com/tianshaokai/jlatexmath/core/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 com.tianshaokai.jlatexmath.core;
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 | }
--------------------------------------------------------------------------------
/jlatexmath/src/main/java/com/tianshaokai/jlatexmath/core/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 com.tianshaokai.jlatexmath.core;
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",
41 | env.getStyle()));
42 | CharBox t = new CharBox(env.getTeXFont().getChar('t', "mathnormal",
43 | env.getStyle()));
44 | HorizontalBox hb = new HorizontalBox(t);
45 | hb.add(new SpaceAtom(TeXConstants.UNIT_EM, -0.3f, 0, 0).createBox(env));
46 | hb.add(A);
47 | return hb;
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/jlatexmath/src/main/java/com/tianshaokai/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 com.tianshaokai.jlatexmath.cyrillic;
30 |
31 | import com.tianshaokai.jlatexmath.core.AlphabetRegistration;
32 |
33 | public class CyrillicRegistration implements AlphabetRegistration {
34 |
35 | public CyrillicRegistration() {
36 | }
37 |
38 | public Character.UnicodeBlock[] getUnicodeBlock() {
39 | return new Character.UnicodeBlock[] { Character.UnicodeBlock.CYRILLIC };
40 | }
41 |
42 | public Object getPackage() {
43 | return this;
44 | }
45 |
46 | public String getTeXFontFileName() {
47 | return "fonts/language_cyrillic.xml";
48 | }
49 | }
--------------------------------------------------------------------------------
/jlatexmath/src/main/java/com/tianshaokai/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 com.tianshaokai.jlatexmath.dynamic;
30 |
31 | public interface ExternalConverter {
32 |
33 | public String getLaTeXString(String externalCode);
34 |
35 | }
--------------------------------------------------------------------------------
/jlatexmath/src/main/java/com/tianshaokai/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 com.tianshaokai.jlatexmath.dynamic;
30 |
31 | public interface ExternalConverterFactory {
32 |
33 | public ExternalConverter getExternalConverter();
34 | }
--------------------------------------------------------------------------------
/jlatexmath/src/main/java/com/tianshaokai/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 com.tianshaokai.jlatexmath.greek;
30 |
31 | import com.tianshaokai.jlatexmath.core.AlphabetRegistration;
32 |
33 | public class GreekRegistration implements AlphabetRegistration {
34 |
35 | public GreekRegistration() {
36 | }
37 |
38 | public Character.UnicodeBlock[] getUnicodeBlock() {
39 | return new Character.UnicodeBlock[] { Character.UnicodeBlock.GREEK,
40 | Character.UnicodeBlock.GREEK_EXTENDED };
41 | }
42 |
43 | public Object getPackage() {
44 | return this;
45 | }
46 |
47 | public String getTeXFontFileName() {
48 | return "fonts/language_greek.xml";
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':MathKeyboard', ':app', "jlatexmath"
2 |
--------------------------------------------------------------------------------