Port new GlyphContext, FontData, enums, props, Bezier and text rendering

This commit is contained in:
Mikael Sand
2017-08-23 05:41:35 +03:00
parent 3cafc34cb2
commit ccb8729917
105 changed files with 10437 additions and 105 deletions
+3 -1
View File
@@ -12,6 +12,7 @@
#import "RNSVGCGFCRule.h"
#import "RNSVGSvgView.h"
#import "RNSVGPath.h"
#import "GlyphContext.h"
#import "RNSVGGlyphContext.h"
@interface RNSVGGroup : RNSVGPath <RNSVGContainer>
@@ -21,7 +22,8 @@
- (void)renderPathTo:(CGContextRef)context;
- (void)renderGroupTo:(CGContextRef)context;
- (RNSVGGlyphContext *)getGlyphContext;
- (RNSVGGlyphContext *)getRNSVGGlyphContext;
- (GlyphContext *)getGlyphContext;
- (void)pushGlyphContext;
- (void)popGlyphContext;
@end
+14 -4
View File
@@ -10,7 +10,8 @@
@implementation RNSVGGroup
{
RNSVGGlyphContext *_glyphContext;
GlyphContext *_glyphContext;
RNSVGGlyphContext *_RNSVGGlyphContext;
}
- (void)renderLayerTo:(CGContextRef)context
@@ -51,22 +52,31 @@
CGFloat width = CGRectGetWidth(clipBounds);
CGFloat height = CGRectGetHeight(clipBounds);
_glyphContext = [[RNSVGGlyphContext alloc] initWithDimensions:width
_RNSVGGlyphContext = [[RNSVGGlyphContext alloc] initWithDimensions:width
height:height];
_glyphContext = [[GlyphContext alloc] initWithScale:1 width:width
height:height];
}
- (RNSVGGlyphContext *)getGlyphContext
- (RNSVGGlyphContext *)getRNSVGGlyphContext
{
return _RNSVGGlyphContext;
}
- (GlyphContext *)getGlyphContext
{
return _glyphContext;
}
- (void)pushGlyphContext
{
[[[self getTextRoot] getGlyphContext] pushContext:self.font];
[[[self getTextRoot] getRNSVGGlyphContext] pushContext:self.font];
[[[self getTextRoot] getGlyphContext] pushContextWithRNSVGGroup:self font:self.font];
}
- (void)popGlyphContext
{
[[[self getTextRoot] getRNSVGGlyphContext] popContext];
[[[self getTextRoot] getGlyphContext] popContext];
}