mirror of
https://github.com/zoriya/react-native-svg.git
synced 2025-12-21 14:25:14 +00:00
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.
49 lines
899 B
Objective-C
49 lines
899 B
Objective-C
/**
|
|
* Copyright (c) 2015-present, Horcrux.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the MIT-style license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
|
|
|
|
#import "RNSVGTextPath.h"
|
|
|
|
@implementation RNSVGTextPath
|
|
|
|
- (void)renderLayerTo:(CGContextRef)context
|
|
{
|
|
[self renderGroupTo:context];
|
|
}
|
|
|
|
- (RNSVGPath *)getPath
|
|
{
|
|
RNSVGSvgView *svg = [self getSvgView];
|
|
RNSVGNode *template = [svg getDefinedTemplate:self.href];
|
|
|
|
if ([template class] != [RNSVGPath class]) {
|
|
// warning about this.
|
|
return nil;
|
|
}
|
|
|
|
RNSVGPath *path = (RNSVGPath *)template;
|
|
return path;
|
|
}
|
|
|
|
- (CGPathRef)getPath:(CGContextRef)context
|
|
{
|
|
return [self getGroupPath:context];
|
|
}
|
|
|
|
- (void)pushGlyphContext
|
|
{
|
|
// TextPath do not affect the glyphContext
|
|
}
|
|
|
|
- (void)popGlyphContext
|
|
{
|
|
// TextPath do not affect the glyphContext
|
|
}
|
|
|
|
@end
|