Skip to content

Commit ad2c515

Browse files
kateryna-rotpandakostub
authored andcommitted
Cyrillic support (#108)
* Xcode 9.4.1 Update to Recommended Settings * Fix 18 Analyze warnings in MTMathAtomFactory.m+.h * Fix 4 Analyze warnings in MTFont.m * Fix 3 yellow warnings in MTTypesetter.m * Fix 2 'Assigned value is garbage or undefined' Analyze issues * Fix 1 Analyze warning in MTFontMathTable.m * Fix 'colorWithRed:green:blue:alpha: is only available on macOS 10.9' yellow warning * added basic cyrillic symbols support
1 parent 87634b4 commit ad2c515

File tree

3 files changed

+16
-5
lines changed

3 files changed

+16
-5
lines changed

iosMath.xcodeproj/project.pbxproj

+11-3
Original file line numberDiff line numberDiff line change
@@ -576,7 +576,7 @@
576576
);
577577
inputPaths = (
578578
"${SRCROOT}/Pods/Target Support Files/Pods-iosMathTests/Pods-iosMathTests-resources.sh",
579-
"${PODS_CONFIGURATION_BUILD_DIR}/iosMath-iOS6.0/mathFonts.bundle",
579+
"${PODS_CONFIGURATION_BUILD_DIR}/iosMath-iOS6.0/mathFonts.bundle",
580580
);
581581
name = "[CP] Copy Pods Resources";
582582
outputPaths = (
@@ -822,11 +822,15 @@
822822
isa = XCBuildConfiguration;
823823
baseConfigurationReference = D93290960585498BBAEE4535 /* Pods-iosMathExample.debug.xcconfig */;
824824
buildSettings = {
825+
CODE_SIGN_IDENTITY = "iPhone Developer";
826+
CODE_SIGN_STYLE = Automatic;
827+
DEVELOPMENT_TEAM = T984FR9Q54;
825828
INFOPLIST_FILE = "iosMathExample/iosMath-Info.plist";
826829
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
827-
PRODUCT_BUNDLE_IDENTIFIER = MathChat.iosMathExample;
830+
PRODUCT_BUNDLE_IDENTIFIER = rotpanda.MathChat.iosMathExample;
828831
PRODUCT_NAME = "$(TARGET_NAME)";
829832
PROVISIONING_PROFILE = "";
833+
PROVISIONING_PROFILE_SPECIFIER = "";
830834
WRAPPER_EXTENSION = app;
831835
};
832836
name = Debug;
@@ -835,11 +839,15 @@
835839
isa = XCBuildConfiguration;
836840
baseConfigurationReference = B16B9A63054AE3FFB5C36F6B /* Pods-iosMathExample.release.xcconfig */;
837841
buildSettings = {
842+
CODE_SIGN_IDENTITY = "iPhone Developer";
843+
CODE_SIGN_STYLE = Automatic;
844+
DEVELOPMENT_TEAM = T984FR9Q54;
838845
INFOPLIST_FILE = "iosMathExample/iosMath-Info.plist";
839846
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
840-
PRODUCT_BUNDLE_IDENTIFIER = MathChat.iosMathExample;
847+
PRODUCT_BUNDLE_IDENTIFIER = rotpanda.MathChat.iosMathExample;
841848
PRODUCT_NAME = "$(TARGET_NAME)";
842849
PROVISIONING_PROFILE = "";
850+
PROVISIONING_PROFILE_SPECIFIER = "";
843851
WRAPPER_EXTENSION = app;
844852
};
845853
name = Release;

iosMath/lib/MTMathAtomFactory.m

+4-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,10 @@ + (MTLargeOperator *)operatorWithName:(NSString *)name limits:(bool) limits
7979
+ (nullable MTMathAtom *)atomForCharacter:(unichar)ch
8080
{
8181
NSString *chStr = [NSString stringWithCharacters:&ch length:1];
82-
if (ch < 0x21 || ch > 0x7E) {
82+
if (ch > 0x0410 && ch < 0x044F){
83+
// show basic cyrillic alphabet. Latin Modern Math font is not good for cyrillic symbols
84+
return [MTMathAtom atomWithType:kMTMathAtomOrdinary value:chStr];
85+
} else if (ch < 0x21 || ch > 0x7E) {
8386
// skip non ascii characters and spaces
8487
return nil;
8588
} else if (ch == '$' || ch == '%' || ch == '#' || ch == '&' || ch == '~' || ch == '\'') {

iosMathExample/example/ViewController.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ - (void)viewDidLoad
8787

8888
// Demo formulae
8989
// Quadratic formula
90-
self.demoLabels[0] = [self createMathLabel:@"x = \\frac{-b \\pm \\sqrt{b^2-4ac}}{2a}" withHeight:60];
90+
self.demoLabels[0] = [self createMathLabel:@"\\text{ваш вопрос: }x = \\frac{-b \\pm \\sqrt{b^2-4ac}}{2a}" withHeight:60];
9191
[self addLabelAsSubview:self.demoLabels[0] to:contentView];
9292
self.demoLabels[0].fontSize = 15;
9393
// This is first label so set the height from the top

0 commit comments

Comments
 (0)