• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How can I get attributed string info in a form I can save?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How can I get attributed string info in a form I can save?


  • Subject: Re: How can I get attributed string info in a form I can save?
  • From: Douglas Davidson <email@hidden>
  • Date: Tue, 08 Mar 2005 12:42:23 -0800

On 2005-03-08 11:59:32 -0800 Dave Camp <email@hidden> wrote:

I need to be able to encode the style information into some custom XML (very much like converting the text into HTML). I was hoping Cocoa would give me something broken down into more detail like:
font = Helvetica
bold = yes
size = 12.00 pt
etc...


How can I get more useful style information about the text? Am I really expected to be able to parse strings like those shown above? There must be another way of doing this.

NSFontManager will tell you whether a particular NSFont is bold, italic, etc. However, not all fonts have all variants of bold/non-bold, italic/non-italic. If you have (for example) a font with no non-bold variant, NSFontManager will correctly tell you that it is bold, but you should be careful when writing this information out in external formats--if you specify that font and request that it be bolded, there are some applications out there that will take that information and then try to synthesize an extra-bolded variant of the already bold font.


There really isn't a standard font naming convention. The most reliable name is the Postscript name, but the name you are looking for may be closer to the family name.

Douglas Davidson

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: How can I get attributed string info in a form I can save?
      • From: Dave Camp <email@hidden>
References: 
 >How can I get attributed string info in a form I can save? (From: Dave Camp <email@hidden>)

  • Prev by Date: Adding controller keys to NSArrayController
  • Next by Date: Re: How can I get attributed string info in a form I can save?
  • Previous by thread: How can I get attributed string info in a form I can save?
  • Next by thread: Re: How can I get attributed string info in a form I can save?
  • Index(es):
    • Date
    • Thread