Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug report #150

Closed
hh-in-zhuzhou opened this issue Feb 1, 2016 · 11 comments
Closed

bug report #150

hh-in-zhuzhou opened this issue Feb 1, 2016 · 11 comments
Labels

Comments

@hh-in-zhuzhou
Copy link

highlight.tapAction = ^(UIView *containerView, NSAttributedString *text, NSRange range, CGRect rect)
这个链接点击方法的参数,当NSAttributedString中含有不同字体大小的文字时,较小字体的链接点击后获取的该链接的rect的width和height都为0, x, y坐标无穷大。

@ibireme
Copy link
Owner

ibireme commented Feb 1, 2016

无法复现。
能给出些能够复现问题的代码吗?

@hh-in-zhuzhou
Copy link
Author

非常感谢您能抽出宝贵的时间回复我。是这样的,我在做一个中医app,我设计了个简单的标记语言,用来标识文本的字体大小和颜色,之后用NSAttributedString来解析并且渲染:
/*
$n{...} 条文序号
$f{...} 方名
$a{...} 内嵌注释
$m{...} 药味总数
$s{...} 药煮法开头的“上...味"
* $u{...} 药名
* $v{...} 药名,但是不显示本经内容
* $w{...} 药量
* $q{...} 方名前缀(千金,外台)
* $h{...} 隐藏的方名(暂时只用于标记方名)
已支持嵌套使用
*/

****这是我要渲染的文本(最后部分有一个标记嵌套):
"39、水去呕止,其人形肿者,加$u{杏仁}主之。其证应内$u{麻黄},以其人遂痹,故不内之;若逆而内之者,必厥。所以然者,以其人血虚,$u{麻黄}发其阳故也。$a{方云$f{苓甘五味加姜辛半夏杏仁汤}}",

渲染出来结果,是正确的,,这个$f{苓甘五味加姜辛半夏杏仁汤},包含在一个$a{} 标记内,这个标记我设置为字体小一号。我给这个XX汤做了一个了链接,,tapAction里头获取的rect就不正常了。

以下是一个方法,用来解析带有以上标记的文本。其中会有链接生成。当要渲染的文本是:
"39、水去呕止,其人形肿者,加$u{杏仁}主之。其证应内$u{麻黄},以其人遂痹,故不内之;若逆而内之者,必厥。所以然者,以其人血虚,$u{麻黄}发其阳故也。$a{方云$f{苓甘五味加姜辛半夏杏仁汤}}",

时,就出问题了。代码写的有点乱,很抱歉,麻烦您了。这是一个研究伤寒杂病论的app。

以下代码使用方法:
NSString *str = ....;
NSMutableAttributedString *astr = [str parseText:YES];

这是一个NSString类的category方法
NSString+XXX.m
-(NSMutableAttributedString )parseText:(BOOL)enableLinks
{
if (!self) {
return nil;
}
NSMutableAttributedString *res = [[NSMutableAttributedString alloc] initWithString:self];
UIFont *font = [HH2SearchConfig sharedConfig].font;
res.yy_font = font;
res.yy_lineSpacing = 4;
/

$n{...} 条文序号
$f{...} 方名
$a{...} 内嵌注释
$m{...} 药味总数
$s{...} 药煮法开头的“上...味"
* $u{...} 药名
* $v{...} 药名,但是不显示本经内容
* $w{...} 药量
* $q{...} 方名前缀(千金,外台) 不允许嵌套使用
* $h{...} 隐藏的方名(暂时只用于标记方名)
已支持嵌套使用
*/
HH2SearchConfig *config = [HH2SearchConfig sharedConfig];
NSDictionary<NSString *, UIColor *> *dict = @{
@"n" : config.nColor,
@"f" : config.fangColor,
@"a" : config.commentColor,
@"m" : config.yaoNumColor,
@"s" : config.zhufaNumColor,
@"u" : config.yaoColor,
@"v" : config.yaoColor,
@"w" : config.yaoAmountColor,
@"q" : config.fangPrefixColor,
@"h" : [UIColor clearColor],
};
NSRange sRange;

while ((sRange = [res.string rangeOfString:@"$"]).location != NSNotFound) {
    NSUInteger pn = sRange.location;
    NSRange range = [res.string rangeOfString:@"}" options:NSCaseInsensitiveSearch range:NSMakeRange(pn, res.string.length - pn)];

    // 检查有没有嵌套的$
    NSString *rest = [res.string substringWithRange:NSMakeRange(pn, range.location - pn)];
    NSInteger n = [rest getAllSubString:@"$"].count;
    NSUInteger m = 1; // 1个}

    while (n > m) {
        NSInteger endPos = pn;
        for (int i = 0; i < n; i++) {
            endPos = [res.string rangeOfString:@"}" options:NSCaseInsensitiveSearch range:NSMakeRange(endPos, res.string.length - endPos)].location + 1;
        }
        m = n;
        range = NSMakeRange(endPos - 1, 1);

        rest = [res.string substringWithRange:NSMakeRange(pn, range.location - pn)];
        n = [rest getAllSubString:@"$"].count;
    }
    // 检查完毕

    NSString *cls = [res.string substringWithRange:NSMakeRange(pn + 1, 1)];
    NSRange innerRange = NSMakeRange(pn + 3, range.location - pn - 3);

    // 隐藏方名的处理
    if ([cls isEqualToString:@"h"]) {
        [res deleteCharactersInRange:NSMakeRange(pn, range.location - pn + 1)];
        continue;
    }else{
        [res yy_setColor:[dict valueForKey:cls] range:innerRange];
        // 药量与注释皆小字显示
        if ([@"wa" containsString:cls]) {
            [res yy_setFont:config.smallFont range:innerRange];
        }
        // 药名加下划线,并且能够点击
        if ([@"uf" containsString:cls]) {
            if (config.showUnderLine && enableLinks) {
                [res yy_setUnderlineColor:[UIColor blackColor] range:innerRange];
                [res yy_setUnderlineStyle:NSUnderlineStyleSingle range:innerRange];
            }

// NSLog(@"%@",[res.string substringWithRange:innerRange]);
YYTextBorder *border = [YYTextBorder borderWithFillColor:[UIColor grayColor] cornerRadius:3];
YYTextHighlight *highlight = [YYTextHighlight new];
[highlight setColor:[UIColor whiteColor]];
[highlight setBackgroundBorder:border];
if ([cls isEqualToString:@"u"]) {
highlight.tapAction = ^(UIView *containerView, NSAttributedString *text, NSRange range, CGRect rect) {
// NSLog(@"tap text:%@",[text.string substringWithRange:range]);
// 你也可以把事件回调放到 YYLabel 和 YYTextView 来处理。
dispatch_async(dispatch_get_main_queue(), ^{
[self showYao:[text.string substringWithRange:range] fromRect:rect containerView:containerView];
}) ;
};
}else{
[res yy_setStrokeWidth:@(-2) range:innerRange];
// [res yy_setUnderlineStyle:NSUnderlineStyleNone range:innerRange];

                highlight.tapAction = ^(UIView *containerView, NSAttributedString *text, NSRange range, CGRect rect) {
                    dispatch_async(dispatch_get_main_queue(), ^{
                        [self showRelatedListForFang:[text.string substringWithRange:range] fromRect:rect containerView:containerView];
                    }) ;
                };
            }
            if (enableLinks) {
                [res yy_setTextHighlight:highlight range:innerRange];
            }
        }
        [res deleteCharactersInRange:NSMakeRange(range.location, 1)];
        [res deleteCharactersInRange:NSMakeRange(pn, 3)];
    }
}

return res;

}

@hh-in-zhuzhou
Copy link
Author

我是您的忠实粉丝,您写的YYTextKit简直太棒了,非常好用:)

@hh-in-zhuzhou
Copy link
Author

注:只有我的这个标记语言有嵌套属性时,内层的highlight链接,会出现rect获取错误。其它的情况都工作良好。

@ibireme
Copy link
Owner

ibireme commented Feb 1, 2016

呃。。好复杂的样子。。
能直接给出个能复现问题的 NSAttributedString 吗?就是直接把最终合成的 NSAttributedString 打印一下 description,长度越短越好。

@hh-in-zhuzhou
Copy link
Author

这个已经是最短的了。。。不打印不知道,一打印吓一跳。。。

40{
CTForegroundColor = "<CGColor 0x14c598210> [<CGColorSpace 0x14c5285d0> (kCGColorSpaceDeviceRGB)](0 0 1 1)";
NSColor = "UIDeviceRGBColorSpace 0 0 1 1";
NSFont = "<UICTFont: 0x14c672d00> font-family: ".SFUIText-Regular"; font-weight: normal; font-style: normal; font-size: 17.00pt";
NSParagraphStyle = "Alignment 4, LineSpacing 4, ParagraphSpacing 0, ParagraphSpacingBefore 0, HeadIndent 0, TailIndent 0, FirstLineHeadIndent 0, LineHeight 0/0, LineHeightMultiple 0, LineBreakMode 0, Tabs (\n 28L,\n 56L,\n 84L,\n 112L,\n 140L,\n 168L,\n 196L,\n 224L,\n 252L,\n 280L,\n 308L,\n 336L\n), DefaultTabInterval 0, Blocks (\n), Lists (\n), BaseWritingDirection -1, HyphenationFactor 0, TighteningForTruncation NO, HeaderLevel 0";
}、若面热如醉,此为胃热上冲,熏其面,加{
NSFont = "<UICTFont: 0x14c672d00> font-family: ".SFUIText-Regular"; font-weight: normal; font-style: normal; font-size: 17.00pt";
NSParagraphStyle = "Alignment 4, LineSpacing 4, ParagraphSpacing 0, ParagraphSpacingBefore 0, HeadIndent 0, TailIndent 0, FirstLineHeadIndent 0, LineHeight 0/0, LineHeightMultiple 0, LineBreakMode 0, Tabs (\n 28L,\n 56L,\n 84L,\n 112L,\n 140L,\n 168L,\n 196L,\n 224L,\n 252L,\n 280L,\n 308L,\n 336L\n), DefaultTabInterval 0, Blocks (\n), Lists (\n), BaseWritingDirection -1, HyphenationFactor 0, TighteningForTruncation NO, HeaderLevel 0";
}大黄{
CTForegroundColor = "<CGColor 0x14c5c26a0> [<CGColorSpace 0x14c5285d0> (kCGColorSpaceDeviceRGB)](0.3 0 1 1)";
CTUnderlineColor = "<CGColor 0x14c56f230> [<CGColorSpace 0x14c6415e0> (kCGColorSpaceDeviceGray)](0 1)";
NSColor = "UIDeviceRGBColorSpace 0.3 0 1 1";
NSFont = "<UICTFont: 0x14c672d00> font-family: ".SFUIText-Regular"; font-weight: normal; font-style: normal; font-size: 17.00pt";
NSParagraphStyle = "Alignment 4, LineSpacing 4, ParagraphSpacing 0, ParagraphSpacingBefore 0, HeadIndent 0, TailIndent 0, FirstLineHeadIndent 0, LineHeight 0/0, LineHeightMultiple 0, LineBreakMode 0, Tabs (\n 28L,\n 56L,\n 84L,\n 112L,\n 140L,\n 168L,\n 196L,\n 224L,\n 252L,\n 280L,\n 308L,\n 336L\n), DefaultTabInterval 0, Blocks (\n), Lists (\n), BaseWritingDirection -1, HyphenationFactor 0, TighteningForTruncation NO, HeaderLevel 0";
NSUnderline = 1;
NSUnderlineColor = "UIDeviceWhiteColorSpace 0 1";
YYTextHighlight = "<YYTextHighlight: 0x14c7265e0>";
}以利之。{
NSFont = "<UICTFont: 0x14c672d00> font-family: ".SFUIText-Regular"; font-weight: normal; font-style: normal; font-size: 17.00pt";
NSParagraphStyle = "Alignment 4, LineSpacing 4, ParagraphSpacing 0, ParagraphSpacingBefore 0, HeadIndent 0, TailIndent 0, FirstLineHeadIndent 0, LineHeight 0/0, LineHeightMultiple 0, LineBreakMode 0, Tabs (\n 28L,\n 56L,\n 84L,\n 112L,\n 140L,\n 168L,\n 196L,\n 224L,\n 252L,\n 280L,\n 308L,\n 336L\n), DefaultTabInterval 0, Blocks (\n), Lists (\n), BaseWritingDirection -1, HyphenationFactor 0, TighteningForTruncation NO, HeaderLevel 0";
}方云{
CTForegroundColor = "<CGColor 0x14c674030> [<CGColorSpace 0x14c6415e0> (kCGColorSpaceDeviceGray)](0.5 1)";
NSColor = "UIDeviceWhiteColorSpace 0.5 1";
NSFont = "<UICTFont: 0x14c673290> font-family: ".SFUIText-Regular"; font-weight: normal; font-style: normal; font-size: 13.00pt";
NSParagraphStyle = "Alignment 4, LineSpacing 4, ParagraphSpacing 0, ParagraphSpacingBefore 0, HeadIndent 0, TailIndent 0, FirstLineHeadIndent 0, LineHeight 0/0, LineHeightMultiple 0, LineBreakMode 0, Tabs (\n 28L,\n 56L,\n 84L,\n 112L,\n 140L,\n 168L,\n 196L,\n 224L,\n 252L,\n 280L,\n 308L,\n 336L\n), DefaultTabInterval 0, Blocks (\n), Lists (\n), BaseWritingDirection -1, HyphenationFactor 0, TighteningForTruncation NO, HeaderLevel 0";
}苓甘五味加姜辛半杏大黄汤{
CTForegroundColor = "<CGColor 0x14c598210> [<CGColorSpace 0x14c5285d0> (kCGColorSpaceDeviceRGB)](0 0 1 1)";
CTUnderlineColor = "<CGColor 0x14c56f230> [<CGColorSpace 0x14c6415e0> (kCGColorSpaceDeviceGray)](0 1)";
NSColor = "UIDeviceRGBColorSpace 0 0 1 1";
NSFont = "<UICTFont: 0x14c673290> font-family: ".SFUIText-Regular"; font-weight: normal; font-style: normal; font-size: 13.00pt";
NSParagraphStyle = "Alignment 4, LineSpacing 4, ParagraphSpacing 0, ParagraphSpacingBefore 0, HeadIndent 0, TailIndent 0, FirstLineHeadIndent 0, LineHeight 0/0, LineHeightMultiple 0, LineBreakMode 0, Tabs (\n 28L,\n 56L,\n 84L,\n 112L,\n 140L,\n 168L,\n 196L,\n 224L,\n 252L,\n 280L,\n 308L,\n 336L\n), DefaultTabInterval 0, Blocks (\n), Lists (\n), BaseWritingDirection -1, HyphenationFactor 0, TighteningForTruncation NO, HeaderLevel 0";
NSStrokeWidth = "-2";
NSUnderline = 1;
NSUnderlineColor = "UIDeviceWhiteColorSpace 0 1";
YYTextHighlight = "<YYTextHighlight: 0x14c726550>";
}

@hh-in-zhuzhou
Copy link
Author

我观察到。如果属性有嵌套时。比如“ ab{c[123]d}ef ", 先给大括号的range,设置某颜色或其他属性。然后再给中间的中括号这个range,再设置一个颜色或其他属性。那么中括号这个range如果再做链接,tapAction获取到的rect就可能宽高为0,x,y为+inf。(+inf是调试运行时控制台显示的)

ibireme added a commit that referenced this issue Feb 1, 2016
@ibireme
Copy link
Owner

ibireme commented Feb 1, 2016

我按照上面那个 NSAttributedString 的描述,重新构造了一个字符串,发现 YYLabel 在查询高亮文本的 rect 时,如果包含了文本结尾的那个字符,则会得到 CGRectNull 的结果。上面这个 commit 修复了一下这个问题,你可以先单独更新一下那个文件看看,如果没有问题了,我会再更新到 cocoapods 去。

@ibireme ibireme added the bug label Feb 1, 2016
@hh-in-zhuzhou
Copy link
Author

#150 看起来解决了。。。
程序终于运行正常了,太感谢了!你太厉害了,一个文件3000多行,我看的头晕。。。

@hh-in-zhuzhou
Copy link
Author

仍然有bug::链接的这个rect的获取,在极少的情况下,仍然存在问题。比如一个2个字的短链接,在屏幕的最右边,没有跨行,获取的rect,应该是个小rect,有时候获取的rect大小竟然是跨行的那种大rect。

设备:iPhone 6s
出问题的链接的range:
range NSRange location=23, length=2

出问题的链接获取到的rect: (实际并未跨行,宽度应该大约50左右,只有2个字,这个获取的结果有错误)
rect CGRect (origin = (x = 0, y = 9.8134765625), size = (width = 343, height = 45.283523437500001))

链接所在的containerView:
(lldb) po containerView
<YYLabel: 0x1460df300; frame = (16 0; 343 292); text = '1、桂枝汤 5味 桂枝三两(去皮),芍药三两,甘草...'; opaque = NO; layer = <YYTextAsyncLayer: 0x1460df5a0>>

链接的text:
@"1、桂枝汤 5味 桂枝三两(去皮),芍药三两,甘草二两,炙,生姜三两(切),大枣十二枚(擘)。\n\t上五味,以水七升,微火煮取三升,去滓,适寒温,服一升。服已须臾,啜热稀粥一升余,以助药力,温覆令一时许,遍身漿漿,微似有汗者益佳,不可令如水流漓,病必不除。若一服汗出病差,停后服,不必尽剂;若不汗,更服依前法;又不汗,后服小促其间,半日许,令三服尽。若病重者,一日一夜服,周时观之。服一剂尽,病证犹在者,更作服。若汗不出,乃服至二三剂。禁生冷、粘滑、肉面、五辛、酒酪、臭恶等物。 "

出问题的NSAttributedString的描述:
1{
CTForegroundColor = "<CGColor 0x144d76e30> [<CGColorSpace 0x144d235c0> (kCGColorSpaceDeviceRGB)](0 0 1 1)";
NSColor = "UIDeviceRGBColorSpace 0 0 1 1";
NSFont = "<UICTFont: 0x144d756d0> font-family: ".SFUIText-Regular"; font-weight: normal; font-style: normal; font-size: 17.00pt";
NSParagraphStyle = "Alignment 4, LineSpacing 4, ParagraphSpacing 0, ParagraphSpacingBefore 0, HeadIndent 0, TailIndent 0, FirstLineHeadIndent 0, LineHeight 0/0, LineHeightMultiple 0, LineBreakMode 0, Tabs (\n 28L,\n 56L,\n 84L,\n 112L,\n 140L,\n 168L,\n 196L,\n 224L,\n 252L,\n 280L,\n 308L,\n 336L\n), DefaultTabInterval 0, Blocks (\n), Lists (\n), BaseWritingDirection -1, HyphenationFactor 0, TighteningForTruncation NO, HeaderLevel 0";
}、{
NSFont = "<UICTFont: 0x144d756d0> font-family: ".SFUIText-Regular"; font-weight: normal; font-style: normal; font-size: 17.00pt";
NSParagraphStyle = "Alignment 4, LineSpacing 4, ParagraphSpacing 0, ParagraphSpacingBefore 0, HeadIndent 0, TailIndent 0, FirstLineHeadIndent 0, LineHeight 0/0, LineHeightMultiple 0, LineBreakMode 0, Tabs (\n 28L,\n 56L,\n 84L,\n 112L,\n 140L,\n 168L,\n 196L,\n 224L,\n 252L,\n 280L,\n 308L,\n 336L\n), DefaultTabInterval 0, Blocks (\n), Lists (\n), BaseWritingDirection -1, HyphenationFactor 0, TighteningForTruncation NO, HeaderLevel 0";
}桂枝汤{
CTForegroundColor = "<CGColor 0x144d76e30> [<CGColorSpace 0x144d235c0> (kCGColorSpaceDeviceRGB)](0 0 1 1)";
CTUnderlineColor = "<CGColor 0x144d3a0e0> [<CGColorSpace 0x144e3ae30> (kCGColorSpaceDeviceGray)](0 1)";
NSColor = "UIDeviceRGBColorSpace 0 0 1 1";
NSFont = "<UICTFont: 0x144d756d0> font-family: ".SFUIText-Regular"; font-weight: normal; font-style: normal; font-size: 17.00pt";
NSParagraphStyle = "Alignment 4, LineSpacing 4, ParagraphSpacing 0, ParagraphSpacingBefore 0, HeadIndent 0, TailIndent 0, FirstLineHeadIndent 0, LineHeight 0/0, LineHeightMultiple 0, LineBreakMode 0, Tabs (\n 28L,\n 56L,\n 84L,\n 112L,\n 140L,\n 168L,\n 196L,\n 224L,\n 252L,\n 280L,\n 308L,\n 336L\n), DefaultTabInterval 0, Blocks (\n), Lists (\n), BaseWritingDirection -1, HyphenationFactor 0, TighteningForTruncation NO, HeaderLevel 0";
NSStrokeWidth = "-2";
NSUnderline = 1;
NSUnderlineColor = "UIDeviceWhiteColorSpace 0 1";
YYTextHighlight = "<YYTextHighlight: 0x144f64a20>";
} 5味{
CTForegroundColor = "<CGColor 0x144d3c2d0> [<CGColorSpace 0x144d235c0> (kCGColorSpaceDeviceRGB)](1 0 0 1)";
NSColor = "UIDeviceRGBColorSpace 1 0 0 1";
NSFont = "<UICTFont: 0x144d756d0> font-family: ".SFUIText-Regular"; font-weight: normal; font-style: normal; font-size: 17.00pt";
NSParagraphStyle = "Alignment 4, LineSpacing 4, ParagraphSpacing 0, ParagraphSpacingBefore 0, HeadIndent 0, TailIndent 0, FirstLineHeadIndent 0, LineHeight 0/0, LineHeightMultiple 0, LineBreakMode 0, Tabs (\n 28L,\n 56L,\n 84L,\n 112L,\n 140L,\n 168L,\n 196L,\n 224L,\n 252L,\n 280L,\n 308L,\n 336L\n), DefaultTabInterval 0, Blocks (\n), Lists (\n), BaseWritingDirection -1, HyphenationFactor 0, TighteningForTruncation NO, HeaderLevel 0";
} {
NSFont = "<UICTFont: 0x144d756d0> font-family: ".SFUIText-Regular"; font-weight: normal; font-style: normal; font-size: 17.00pt";
NSParagraphStyle = "Alignment 4, LineSpacing 4, ParagraphSpacing 0, ParagraphSpacingBefore 0, HeadIndent 0, TailIndent 0, FirstLineHeadIndent 0, LineHeight 0/0, LineHeightMultiple 0, LineBreakMode 0, Tabs (\n 28L,\n 56L,\n 84L,\n 112L,\n 140L,\n 168L,\n 196L,\n 224L,\n 252L,\n 280L,\n 308L,\n 336L\n), DefaultTabInterval 0, Blocks (\n), Lists (\n), BaseWritingDirection -1, HyphenationFactor 0, TighteningForTruncation NO, HeaderLevel 0";
}桂枝{
CTForegroundColor = "<CGColor 0x144daa7d0> [<CGColorSpace 0x144d235c0> (kCGColorSpaceDeviceRGB)](0.3 0 1 1)";
CTUnderlineColor = "<CGColor 0x144d3a0e0> [<CGColorSpace 0x144e3ae30> (kCGColorSpaceDeviceGray)](0 1)";
NSColor = "UIDeviceRGBColorSpace 0.3 0 1 1";
NSFont = "<UICTFont: 0x144d756d0> font-family: ".SFUIText-Regular"; font-weight: normal; font-style: normal; font-size: 17.00pt";
NSParagraphStyle = "Alignment 4, LineSpacing 4, ParagraphSpacing 0, ParagraphSpacingBefore 0, HeadIndent 0, TailIndent 0, FirstLineHeadIndent 0, LineHeight 0/0, LineHeightMultiple 0, LineBreakMode 0, Tabs (\n 28L,\n 56L,\n 84L,\n 112L,\n 140L,\n 168L,\n 196L,\n 224L,\n 252L,\n 280L,\n 308L,\n 336L\n), DefaultTabInterval 0, Blocks (\n), Lists (\n), BaseWritingDirection -1, HyphenationFactor 0, TighteningForTruncation NO, HeaderLevel 0";
NSUnderline = 1;
NSUnderlineColor = "UIDeviceWhiteColorSpace 0 1";
YYTextHighlight = "<YYTextHighlight: 0x144f76da0>";
}三两(去皮){
CTForegroundColor = "<CGColor 0x144de4040> [<CGColorSpace 0x144d235c0> (kCGColorSpaceDeviceRGB)](0 0.5 0 1)";
NSColor = "UIDeviceRGBColorSpace 0 0.5 0 1";
NSFont = "<UICTFont: 0x144d75c60> font-family: ".SFUIText-Regular"; font-weight: normal; font-style: normal; font-size: 13.00pt";
NSParagraphStyle = "Alignment 4, LineSpacing 4, ParagraphSpacing 0, ParagraphSpacingBefore 0, HeadIndent 0, TailIndent 0, FirstLineHeadIndent 0, LineHeight 0/0, LineHeightMultiple 0, LineBreakMode 0, Tabs (\n 28L,\n 56L,\n 84L,\n 112L,\n 140L,\n 168L,\n 196L,\n 224L,\n 252L,\n 280L,\n 308L,\n 336L\n), DefaultTabInterval 0, Blocks (\n), Lists (\n), BaseWritingDirection -1, HyphenationFactor 0, TighteningForTruncation NO, HeaderLevel 0";
},{
NSFont = "<UICTFont: 0x144d756d0> font-family: ".SFUIText-Regular"; font-weight: normal; font-style: normal; font-size: 17.00pt";
NSParagraphStyle = "Alignment 4, LineSpacing 4, ParagraphSpacing 0, ParagraphSpacingBefore 0, HeadIndent 0, TailIndent 0, FirstLineHeadIndent 0, LineHeight 0/0, LineHeightMultiple 0, LineBreakMode 0, Tabs (\n 28L,\n 56L,\n 84L,\n 112L,\n 140L,\n 168L,\n 196L,\n 224L,\n 252L,\n 280L,\n 308L,\n 336L\n), DefaultTabInterval 0, Blocks (\n), Lists (\n), BaseWritingDirection -1, HyphenationFactor 0, TighteningForTruncation NO, HeaderLevel 0";
}芍药{
CTForegroundColor = "<CGColor 0x144daa7d0> [<CGColorSpace 0x144d235c0> (kCGColorSpaceDeviceRGB)](0.3 0 1 1)";
CTUnderlineColor = "<CGColor 0x144d3a0e0> [<CGColorSpace 0x144e3ae30> (kCGColorSpaceDeviceGray)](0 1)";
NSColor = "UIDeviceRGBColorSpace 0.3 0 1 1";
NSFont = "<UICTFont: 0x144d756d0> font-family: ".SFUIText-Regular"; font-weight: normal; font-style: normal; font-size: 17.00pt";
NSParagraphStyle = "Alignment 4, LineSpacing 4, ParagraphSpacing 0, ParagraphSpacingBefore 0, HeadIndent 0, TailIndent 0, FirstLineHeadIndent 0, LineHeight 0/0, LineHeightMultiple 0, LineBreakMode 0, Tabs (\n 28L,\n 56L,\n 84L,\n 112L,\n 140L,\n 168L,\n 196L,\n 224L,\n 252L,\n 280L,\n 308L,\n 336L\n), DefaultTabInterval 0, Blocks (\n), Lists (\n), BaseWritingDirection -1, HyphenationFactor 0, TighteningForTruncation NO, HeaderLevel 0";
NSUnderline = 1;
NSUnderlineColor = "UIDeviceWhiteColorSpace 0 1";
YYTextHighlight = "<YYTextHighlight: 0x144f4f940>";
}三两{
CTForegroundColor = "<CGColor 0x144de4040> [<CGColorSpace 0x144d235c0> (kCGColorSpaceDeviceRGB)](0 0.5 0 1)";
NSColor = "UIDeviceRGBColorSpace 0 0.5 0 1";
NSFont = "<UICTFont: 0x144d75c60> font-family: ".SFUIText-Regular"; font-weight: normal; font-style: normal; font-size: 13.00pt";
NSParagraphStyle = "Alignment 4, LineSpacing 4, ParagraphSpacing 0, ParagraphSpacingBefore 0, HeadIndent 0, TailIndent 0, FirstLineHeadIndent 0, LineHeight 0/0, LineHeightMultiple 0, LineBreakMode 0, Tabs (\n 28L,\n 56L,\n 84L,\n 112L,\n 140L,\n 168L,\n 196L,\n 224L,\n 252L,\n 280L,\n 308L,\n 336L\n), DefaultTabInterval 0, Blocks (\n), Lists (\n), BaseWritingDirection -1, HyphenationFactor 0, TighteningForTruncation NO, HeaderLevel 0";
},{
NSFont = "<UICTFont: 0x144d756d0> font-family: ".SFUIText-Regular"; font-weight: normal; font-style: normal; font-size: 17.00pt";
NSParagraphStyle = "Alignment 4, LineSpacing 4, ParagraphSpacing 0, ParagraphSpacingBefore 0, HeadIndent 0, TailIndent 0, FirstLineHeadIndent 0, LineHeight 0/0, LineHeightMultiple 0, LineBreakMode 0, Tabs (\n 28L,\n 56L,\n 84L,\n 112L,\n 140L,\n 168L,\n 196L,\n 224L,\n 252L,\n 280L,\n 308L,\n 336L\n), DefaultTabInterval 0, Blocks (\n), Lists (\n), BaseWritingDirection -1, HyphenationFactor 0, TighteningForTruncation NO, HeaderLevel 0";
}甘草{
CTForegroundColor = "<CGColor 0x144daa7d0> [<CGColorSpace 0x144d235c0> (kCGColorSpaceDeviceRGB)](0.3 0 1 1)";
CTUnderlineColor = "<CGColor 0x144d3a0e0> [<CGColorSpace 0x144e3ae30> (kCGColorSpaceDeviceGray)](0 1)";
NSColor = "UIDeviceRGBColorSpace 0.3 0 1 1";
NSFont = "<UICTFont: 0x144d756d0> font-family: ".SFUIText-Regular"; font-weight: normal; font-style: normal; font-size: 17.00pt";
NSParagraphStyle = "Alignment 4, LineSpacing 4, ParagraphSpacing 0, ParagraphSpacingBefore 0, HeadIndent 0, TailIndent 0, FirstLineHeadIndent 0, LineHeight 0/0, LineHeightMultiple 0, LineBreakMode 0, Tabs (\n 28L,\n 56L,\n 84L,\n 112L,\n 140L,\n 168L,\n 196L,\n 224L,\n 252L,\n 280L,\n 308L,\n 336L\n), DefaultTabInterval 0, Blocks (\n), Lists (\n), BaseWritingDirection -1, HyphenationFactor 0, TighteningForTruncation NO, HeaderLevel 0";
NSUnderline = 1;
NSUnderlineColor = "UIDeviceWhiteColorSpace 0 1";
YYTextHighlight = "<YYTextHighlight: 0x144f69050>";
}二两,炙{
CTForegroundColor = "<CGColor 0x144de4040> [<CGColorSpace 0x144d235c0> (kCGColorSpaceDeviceRGB)](0 0.5 0 1)";
NSColor = "UIDeviceRGBColorSpace 0 0.5 0 1";
NSFont = "<UICTFont: 0x144d75c60> font-family: ".SFUIText-Regular"; font-weight: normal; font-style: normal; font-size: 13.00pt";
NSParagraphStyle = "Alignment 4, LineSpacing 4, ParagraphSpacing 0, ParagraphSpacingBefore 0, HeadIndent 0, TailIndent 0, FirstLineHeadIndent 0, LineHeight 0/0, LineHeightMultiple 0, LineBreakMode 0, Tabs (\n 28L,\n 56L,\n 84L,\n 112L,\n 140L,\n 168L,\n 196L,\n 224L,\n 252L,\n 280L,\n 308L,\n 336L\n), DefaultTabInterval 0, Blocks (\n), Lists (\n), BaseWritingDirection -1, HyphenationFactor 0, TighteningForTruncation NO, HeaderLevel 0";
},{
NSFont = "<UICTFont: 0x144d756d0> font-family: ".SFUIText-Regular"; font-weight: normal; font-style: normal; font-size: 17.00pt";
NSParagraphStyle = "Alignment 4, LineSpacing 4, ParagraphSpacing 0, ParagraphSpacingBefore 0, HeadIndent 0, TailIndent 0, FirstLineHeadIndent 0, LineHeight 0/0, LineHeightMultiple 0, LineBreakMode 0, Tabs (\n 28L,\n 56L,\n 84L,\n 112L,\n 140L,\n 168L,\n 196L,\n 224L,\n 252L,\n 280L,\n 308L,\n 336L\n), DefaultTabInterval 0, Blocks (\n), Lists (\n), BaseWritingDirection -1, HyphenationFactor 0, TighteningForTruncation NO, HeaderLevel 0";
}生姜{
CTForegroundColor = "<CGColor 0x144daa7d0> [<CGColorSpace 0x144d235c0> (kCGColorSpaceDeviceRGB)](0.3 0 1 1)";
CTUnderlineColor = "<CGColor 0x144d3a0e0> [<CGColorSpace 0x144e3ae30> (kCGColorSpaceDeviceGray)](0 1)";
NSColor = "UIDeviceRGBColorSpace 0.3 0 1 1";
NSFont = "<UICTFont: 0x144d756d0> font-family: ".SFUIText-Regular"; font-weight: normal; font-style: normal; font-size: 17.00pt";
NSParagraphStyle = "Alignment 4, LineSpacing 4, ParagraphSpacing 0, ParagraphSpacingBefore 0, HeadIndent 0, TailIndent 0, FirstLineHeadIndent 0, LineHeight 0/0, LineHeightMultiple 0, LineBreakMode 0, Tabs (\n 28L,\n 56L,\n 84L,\n 112L,\n 140L,\n 168L,\n 196L,\n 224L,\n 252L,\n 280L,\n 308L,\n 336L\n), DefaultTabInterval 0, Blocks (\n), Lists (\n), BaseWritingDirection -1, HyphenationFactor 0, TighteningForTruncation NO, HeaderLevel 0";
NSUnderline = 1;
NSUnderlineColor = "UIDeviceWhiteColorSpace 0 1";
YYTextHighlight = "<YYTextHighlight: 0x144f564a0>";
}三两(切){
CTForegroundColor = "<CGColor 0x144de4040> [<CGColorSpace 0x144d235c0> (kCGColorSpaceDeviceRGB)](0 0.5 0 1)";
NSColor = "UIDeviceRGBColorSpace 0 0.5 0 1";
NSFont = "<UICTFont: 0x144d75c60> font-family: ".SFUIText-Regular"; font-weight: normal; font-style: normal; font-size: 13.00pt";
NSParagraphStyle = "Alignment 4, LineSpacing 4, ParagraphSpacing 0, ParagraphSpacingBefore 0, HeadIndent 0, TailIndent 0, FirstLineHeadIndent 0, LineHeight 0/0, LineHeightMultiple 0, LineBreakMode 0, Tabs (\n 28L,\n 56L,\n 84L,\n 112L,\n 140L,\n 168L,\n 196L,\n 224L,\n 252L,\n 280L,\n 308L,\n 336L\n), DefaultTabInterval 0, Blocks (\n), Lists (\n), BaseWritingDirection -1, HyphenationFactor 0, TighteningForTruncation NO, HeaderLevel 0";
},{
NSFont = "<UICTFont: 0x144d756d0> font-family: ".SFUIText-Regular"; font-weight: normal; font-style: normal; font-size: 17.00pt";
NSParagraphStyle = "Alignment 4, LineSpacing 4, ParagraphSpacing 0, ParagraphSpacingBefore 0, HeadIndent 0, TailIndent 0, FirstLineHeadIndent 0, LineHeight 0/0, LineHeightMultiple 0, LineBreakMode 0, Tabs (\n 28L,\n 56L,\n 84L,\n 112L,\n 140L,\n 168L,\n 196L,\n 224L,\n 252L,\n 280L,\n 308L,\n 336L\n), DefaultTabInterval 0, Blocks (\n), Lists (\n), BaseWritingDirection -1, HyphenationFactor 0, TighteningForTruncation NO, HeaderLevel 0";
}大枣{
CTForegroundColor = "<CGColor 0x144daa7d0> [<CGColorSpace 0x144d235c0> (kCGColorSpaceDeviceRGB)](0.3 0 1 1)";
CTUnderlineColor = "<CGColor 0x144d3a0e0> [<CGColorSpace 0x144e3ae30> (kCGColorSpaceDeviceGray)](0 1)";
NSColor = "UIDeviceRGBColorSpace 0.3 0 1 1";
NSFont = "<UICTFont: 0x144d756d0> font-family: ".SFUIText-Regular"; font-weight: normal; font-style: normal; font-size: 17.00pt";
NSParagraphStyle = "Alignment 4, LineSpacing 4, ParagraphSpacing 0, ParagraphSpacingBefore 0, HeadIndent 0, TailIndent 0, FirstLineHeadIndent 0, LineHeight 0/0, LineHeightMultiple 0, LineBreakMode 0, Tabs (\n 28L,\n 56L,\n 84L,\n 112L,\n 140L,\n 168L,\n 196L,\n 224L,\n 252L,\n 280L,\n 308L,\n 336L\n), DefaultTabInterval 0, Blocks (\n), Lists (\n), BaseWritingDirection -1, HyphenationFactor 0, TighteningForTruncation NO, HeaderLevel 0";
NSUnderline = 1;
NSUnderlineColor = "UIDeviceWhiteColorSpace 0 1";
YYTextHighlight = "<YYTextHighlight: 0x144f56440>";
}十二枚(擘){
CTForegroundColor = "<CGColor 0x144de4040> [<CGColorSpace 0x144d235c0> (kCGColorSpaceDeviceRGB)](0 0.5 0 1)";
NSColor = "UIDeviceRGBColorSpace 0 0.5 0 1";
NSFont = "<UICTFont: 0x144d75c60> font-family: ".SFUIText-Regular"; font-weight: normal; font-style: normal; font-size: 13.00pt";
NSParagraphStyle = "Alignment 4, LineSpacing 4, ParagraphSpacing 0, ParagraphSpacingBefore 0, HeadIndent 0, TailIndent 0, FirstLineHeadIndent 0, LineHeight 0/0, LineHeightMultiple 0, LineBreakMode 0, Tabs (\n 28L,\n 56L,\n 84L,\n 112L,\n 140L,\n 168L,\n 196L,\n 224L,\n 252L,\n 280L,\n 308L,\n 336L\n), DefaultTabInterval 0, Blocks (\n), Lists (\n), BaseWritingDirection -1, HyphenationFactor 0, TighteningForTruncation NO, HeaderLevel 0";
}。
上五味,以水七升,微火煮取三升,去滓,适寒温,服一升。服已须臾,啜热稀粥一升余,以助药力,温覆令一时许,遍身漿漿,微似有汗者益佳,不可令如水流漓,病必不除。若一服汗出病差,停后服,不必尽剂;若不汗,更服依前法;又不汗,后服小促其间,半日许,令三服尽。若病重者,一日一夜服,周时观之。服一剂尽,病证犹在者,更作服。若汗不出,乃服至二三剂。禁生冷、粘滑、肉面、五辛、酒酪、臭恶等物。 {
NSFont = "<UICTFont: 0x144d756d0> font-family: ".SFUIText-Regular"; font-weight: normal; font-style: normal; font-size: 17.00pt";
NSParagraphStyle = "Alignment 4, LineSpacing 4, ParagraphSpacing 0, ParagraphSpacingBefore 0, HeadIndent 0, TailIndent 0, FirstLineHeadIndent 0, LineHeight 0/0, LineHeightMultiple 0, LineBreakMode 0, Tabs (\n 28L,\n 56L,\n 84L,\n 112L,\n 140L,\n 168L,\n 196L,\n 224L,\n 252L,\n 280L,\n 308L,\n 336L\n), DefaultTabInterval 0, Blocks (\n), Lists (\n), BaseWritingDirection -1, HyphenationFactor 0, TighteningForTruncation NO, HeaderLevel 0";
}

@hh-in-zhuzhou
Copy link
Author

链接所在的containerView:
(lldb) po containerView
YYLabel: 0x136a3db20; frame = (16 0; 343 292); text = '1、桂枝汤 5味 桂枝三两(去皮),芍药三两,甘草...'; opaque = NO; layer = YYTextAsyncLayer: 0x136a3ddc0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants