mirror of
https://github.com/zoriya/react-native-svg.git
synced 2026-06-01 06:07:41 +00:00
Implement kerning, ligatures, etc., and cleanup; in ios.
Implement hasGlyph ligature helper. Export view property setters for: text: textLength, baselineShift, lengthAdjust, alignmentBaseline, textPath: side, method, midLine, spacing. Attempt to fix alignmentBaseline and baselineShift, but both properties are nil at all times, I must be missing something.
This commit is contained in:
@@ -10,14 +10,12 @@
|
||||
#import "RNSVGTextPath.h"
|
||||
#import <React/RCTFont.h>
|
||||
#import <CoreText/CoreText.h>
|
||||
#import "RNSVGGlyphContext.h"
|
||||
#import "GlyphContext.h"
|
||||
|
||||
@implementation RNSVGText
|
||||
{
|
||||
RNSVGText *_textRoot;
|
||||
GlyphContext *_glyphContext;
|
||||
RNSVGGlyphContext *_RNSVGGlyphContext;
|
||||
}
|
||||
|
||||
- (void)renderLayerTo:(CGContextRef)context
|
||||
@@ -40,8 +38,6 @@
|
||||
{
|
||||
_glyphContext = [[GlyphContext alloc] initWithScale:1 width:[self getContextWidth]
|
||||
height:[self getContextHeight]];
|
||||
_RNSVGGlyphContext = [[RNSVGGlyphContext alloc] initWithDimensions:[self getContextWidth]
|
||||
height:[self getContextHeight]];
|
||||
}
|
||||
|
||||
// release the cached CGPathRef for RNSVGTSpan
|
||||
@@ -95,11 +91,6 @@
|
||||
return _textRoot;
|
||||
}
|
||||
|
||||
- (RNSVGGlyphContext *)getRNSVGGlyphContext
|
||||
{
|
||||
return _RNSVGGlyphContext;
|
||||
}
|
||||
|
||||
- (GlyphContext *)getGlyphContext
|
||||
{
|
||||
return _glyphContext;
|
||||
@@ -107,12 +98,6 @@
|
||||
|
||||
- (void)pushGlyphContext
|
||||
{
|
||||
/*
|
||||
[[[self getTextRoot] getRNSVGGlyphContext] pushContext:self.font
|
||||
deltaX:self.deltaX
|
||||
deltaY:self.deltaY
|
||||
positionX:self.positionX
|
||||
positionY:self.positionY];*/
|
||||
[[[self getTextRoot] getGlyphContext] pushContextwithRNSVGText:self
|
||||
reset:false
|
||||
font:self.font
|
||||
@@ -125,7 +110,6 @@
|
||||
|
||||
- (void)popGlyphContext
|
||||
{
|
||||
//[[[self getTextRoot] getRNSVGGlyphContext] popContext];
|
||||
[[[self getTextRoot] getGlyphContext] popContext];
|
||||
}
|
||||
|
||||
@@ -134,9 +118,4 @@
|
||||
return [[[self getTextRoot] getGlyphContext] getGlyphFont];
|
||||
}
|
||||
|
||||
- (CGPoint)getGlyphPointFromContext:(CGPoint)offset glyphWidth:(CGFloat)glyphWidth
|
||||
{
|
||||
return [[[self getTextRoot] getRNSVGGlyphContext] getNextGlyphPoint:(CGPoint)offset glyphWidth:glyphWidth];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user