Here¹s the repository containing my HTML pages https://github.com/leonardodev/htmlpages
Regards -- Leonardo Da: Jens Alfke <[email protected]> Data: Sat, 4 Jan 2014 13:40:09 -0800 A: Leonardo <[email protected]> Cc: <[email protected]> Oggetto: Re: NSHTMLTextDocumentType returns wrong font names On Jan 4, 2014, at 3:03 AM, Leonardo <[email protected]> wrote: > I'm trying to export the content of my NSTextView to an HTML page. > I get the HTML code using > > NSDictionary *attributes = [NSDictionary > dictionaryWithObjectsAndKeys:NSHTMLTextDocumentType, > NSDocumentTypeDocumentAttribute, nil]; > NSData *htmlData = [textView dataFromRange:editedRange > attributes error:NULL]; There¹s no such method on NSTextView, and the last line isn¹t even syntactically correct. I think you¹re referring to the NSAttributedString method - (NSData *)dataFromRange:(NSRange)range documentAttributes:(NSDictionary *)dict error:(NSError **)error; which you¹re probably calling on textView.textStorage. Can you show us some of the generated HTML with the incorrect font names? > - if I use the font name Helvetica-LightOblique, it returns 'Helvetica > Light'. And I get a different font look, as Times. Yeah, that sounds wrong. By default CSS wants the font¹s PostScript name, which is like ³Helvetica-LightOblique². It¹s possible to reassign font names using @-directives in the CSS, but that seems like an unlikely thing for AppKit to be generating. Jens _______________________________________________ Cocoa-dev mailing list ([email protected]) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [email protected]
