Using Os 9 Resource Fork Fonts in CSS with @Font-Face

Using OS 9 resource fork fonts in CSS with @font-face

Font Suitcases can potentially hold 2 different kinds of fonts: bitmap fonts and TrueType fonts. Bitmap fonts would be 'NFNT' resources along with the necessary 'FOND' (font family information). On the other hand, TrueType fonts would be 'sfnt' resource entries along with the necessary 'FOND' (font family information). Normally, font suitcases that hold bitmap font data are only one half of the font; to be usable you need to have the additional PostScript Outline font files (these will have an LWFN icon).

Otherwise, the font suitcase can represent a TrueType font, which compared to a "PostScript Type 1 Font Suitcase", is truly self-contained.

To convert from a resource-file-based Mac TrueType font to a Windows TrueType font, you just need to extract the 'sfnt' resource entries).

Since Rosetta is no more, I'm without Resorcerer, so I've managed to whip up a barebones resource file editor.

https://markdouma.com/developer/ResourceFinagler.zip

I just added a few lines so that you can now select the individual 'sfnt' resources like shown in the image below, and drag them to the Finder to create the individual Windows TrueType fonts.

Sample Image

Sample Image

Custom Font for label

You can find the font name by looking for the app in the Font Book app on your Mac: Font Book App Screen Shot

Search for the Font and select it, then click on the info tab to get the name to use the font. Also, you can find the available fonts using fontNamesForFamilyName like this:

NSLog(@"%@", [UIFont fontNamesForFamilyName:@"Arial"]);

will print:

    (
ArialMT,
"Arial-BoldItalicMT",
"Arial-ItalicMT",
"Arial-BoldMT"
)

Then set it like so:

[label setFont:[UIFont fontWithName:@"Arial-BoldItalicMT" size:20]];

Font's and font face not working on godaddy server

i got the solution there is issue with file extensions.my old file extension was .TTF ,.OTF now i am using .ttf , .otf .some time it not work for specific file then use .TTF ,.OTF and remove space, - from file names its working now better .

@font-face not displayed in Chrome (Windows)

The problem was solved. Font Squirrel are broken my font, so I used fontface.codeandmore.com service, his @ font-face kit perfectly displayed on any browser including Chrome (Windows). Thank you all for your help!

Cocoa WebView (MacApp) - how to use custom fonts?

I have tried two approaches to load webpages with custom fonts.

  • From the app bundle (using NSBundle)
  • From a local path specified by the user (using absolute path)

In both cases I am successfully able to display Custom Fonts. There is a HTML file and beside it, a .ttf font file. In the HTML file I have defined @font-face in inline CSS.

In the second case you can give any full path from local filesystem and the webview will load from that (like /Users/johndoe/Desktop/maiwebsite/index.html).

Code is on Github.

And from another answer on SO:

  1. Instead of getting the resource path and stapling a subpath onto it yourself, ask the bundle to give you the correct path.
  2. Instead of handling a path at all, ask the bundle to give you the correct URL. (Requires Mac OS X 10.6 or later.)

If this doesn't help then could you put up your code somewhere so we can try to debug it?



Related Topics



Leave a reply



Submit