-
Notifications
You must be signed in to change notification settings - Fork 158
/
CMHTMLSubscriptTransformer.h
51 lines (44 loc) · 1.32 KB
/
CMHTMLSubscriptTransformer.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
//
// CMHTMLSubscriptTransformer.h
// CocoaMarkdown
//
// Created by Indragie on 1/16/15.
// Copyright (c) 2015 Indragie Karunaratne. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "CMHTMLScriptTransformer.h"
#if TARGET_OS_IPHONE
#import <UIKit/UIKit.h>
#else
#import <Cocoa/Cocoa.h>
#endif
/**
* Transforms HTML subscript elements (<sub>) into attributed strings.
*/
@interface CMHTMLSubscriptTransformer : CMHTMLScriptTransformer
/**
* Initializes the receiver with the default font ratio (0.7)
*
* @return An initialized instance of the receiver.
*/
- (instancetype)init;
/**
* Initializes the receiver with a custom font size ratio.
*
* @param ratio The factor to multiply the existing font point
* size by to calculate the size of the subscript font.
*
* @return An initialized instance of the receiver.
*/
- (instancetype)initWithFontSizeRatio:(CGFloat)ratio;
/**
* Initializes the receiver with a custom font size ratio and a custom baseline offset.
*
* @param ratio The factor to multiply the existing font point
* size by to calculate the size of the superscript font.
* @param offset The offset for the baseline of the subscript.
*
* @return An initialized instance of the receiver.
*/
- (instancetype)initWithFontSizeRatio:(CGFloat)ratio baselineOffset:(CGFloat)offset;
@end