Cocoanetics / DTCoreText

Methods to allow using HTML code with CoreText
BSD 2-Clause "Simplified" License
6.35k stars 1.18k forks source link

Honor text-transformation: uppercase #791

Closed matiasgarciaisaia closed 7 years ago

matiasgarciaisaia commented 10 years ago
    DTCSSStylesheet* style = [[DTCSSStylesheet alloc] initWithStyleBlock:@"\
                              emphasis { \
                                  text-transform: uppercase; \
                              }\
                              "];
    NSDictionary *options = @{
                              DTUseiOS6Attributes: [NSNumber numberWithBool:YES],
                              NSTextSizeMultiplierDocumentOption: [NSNumber numberWithFloat: 1.0],
                              DTDefaultFontFamily: self.font.familyName,
                              DTDefaultFontName: self.font.fontName,
                              DTDefaultFontSize: [NSNumber numberWithFloat: self.font.pointSize],
                              DTDefaultStyleSheet: style
                              };

    NSData *data = [self.html dataUsingEncoding:NSUTF8StringEncoding ];
    _attributedText = [[NSAttributedString alloc] initWithHTMLData:data
                                                           options:options
                                                documentAttributes:NULL];

This completely ignores the text-transform: uppercase style. It would be great to support this and other transformations.

odrobnik commented 7 years ago

Since there has not being any activity on this issue in several months we are closing it for now. If you are interested in providing a fix or solution you are encouraged to provide a pull request.

Please read the release notes for the latest 1.6.20 release. If you still require assistance, you can hire me to work on your issues for a reasonable fee.