mirror of
https://github.com/zoriya/react-native-svg.git
synced 2026-05-30 05:31:01 +00:00
Port new GlyphContext, FontData, enums, props, Bezier and text rendering
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user