IPhone OS Use custom font

Hi Everyone.
I´m new here and I´ve sent lots of mail to the iPhone OS Team but with no success so I´m trying here hoping that someone could help out ...
What I´m trying to do should be simple, but its seems it´s not that simple.
in my iPhone App that I´m developing using the iPhone SDK I´m realy limited with the Fonts avaible on the Phone ... so I want to use a custom font in the App... A font that would be included in the Resource Bundle
I cant get this to work at all so please pleaase if anyone here could tell me and maybe outhers how this is done I would be so happy ...
here are some psudo code I´ve written that does not work but I think I´m on the right path ...
NSString* fontPath = [[NSBundle mainBundle] pathForResource:@"Arial" ofType:@"ttf"];
CGDataProviderRef fontDataProvider = CGDataProviderCreateWithFilename(fontPath);
CGFontRef myfont = CGFontCreateWithDataProvider(fontDataProvider);
CGContextSetFont(context, myfont);
Please ....

Hello,
Has anybody been able to get this to work? I've tried combining this with the Quartz Guide's example on how to draw text and all I get is a blank screen. I even tried using the Quartz guide exactly without the custom font and it still doesn't work.
Here is my code: (But no text displays and no errors)
- (void)drawRect:(CGRect)rect {
CGContextRef context = UIGraphicsGetCurrentContext();
[self MyDrawText:context rect:rect];
- (void)MyDrawText:(CGContextRef)myContext rect:(CGRect)contextRect
float w, h;
w = contextRect.size.width;
h = contextRect.size.height;
CGAffineTransform myTextTransform; // 2
CGContextSelectFont (myContext, // 3
"Times-Bold",
h/10,
kCGEncodingMacRoman);
CGContextSetCharacterSpacing (myContext, 10); // 4
CGContextSetTextDrawingMode (myContext, kCGTextFillStroke); // 5
CGContextSetRGBFillColor (myContext, 0, 1, 0, .5); // 6
CGContextSetRGBStrokeColor (myContext, 0, 0, 1, 1); // 7
CGContextShowTextAtPoint (myContext, 40, 0, "Quartz 2D", 9); // 10
}

Similar Messages

  • Using custom fonts in the Navigation pane

    Hi
    I'm using custom fonts in my webhelp. To do this, I created a folder for the web versions of the custom fonts and put it in the same folder as my css. I then added the font face elements to the top of my css (in Notepad). Next I used the custom font name for all the style defined in the css (in Notepad). That makes the content of the topics use the custom font. All good.
    Next, I edited the htt file (in Notepad) to use the name of the custom font. Now the breadcrumbs and topic footer use the custom font. All good.
    Finally, I want to use the custom font in the navigation pane (the text next to the books and page icons). I edited the skn file (in Notepad) to use the custom font. I also added a dependency for my css to the bottom of the skn file. Then I generated the webhelp.
    When I launch the help, the browser (IE) doesn’t allow running scripts or ActiveX controls (this is normal). At this point, the TOC in the Navigation pane looks like it uses the correct font. Once I click to allow IE to run scripts, etc. the font in the TOC changes to something that looks like Times or some default serif font.  So, it appears that something in the javascript is changing the font.
    For good measure, I checked the whtdhtml file and the custom font name is used there.
    Any ideas on what's happening and how to get my custom font to appear in the Navigation pane?
    BTW, I use images only in the toolbar pane (that spans the top of the webhelp window), so I don't need to specify the custom font there.
    Deborah

    Hi William
    I found one error. In the skin file, I had added a dependency to my css. It was missing a slash (/) to point to the correct folder level. Now that I've added that, the TOC displays the same font as the Index, Search results, and the topic (content, breadcrumbs, and footer). So, that's good, but on closer inspection, it looks like Verdana, not my custom font.
    I changed the font in whthost.js to the name of my custom font and generated the help, but it made no difference. I also changed the font and just opened the help without generating and got the same results.
    For your second suggestion, you mean whtdhtml.htm not whtdhtml.js? The custom font is in the lines:
    setFont("Normal", "MyFont","10pt","Black","Normal","Normal","none");
    setFont("Hover", "MyFont","10pt","#004080","Normal","Normal","underline");
    I added the <font> tag to this file, but the tag just shows up as plain text within the webhelp TOC (no matter where I insert it in the file).
    I also tried changing the font to my custom font for the Index body and Search results using the steps in Rick's Skinny on Skins (editing the whibody.htm and whfbody.htm files). When I do this, the serif font appears in the Index body and Search results.
    It seems like the files cannot "see" my custom fonts (which are in a folder at the same level as my css).
    Deborah

  • Using custom fonts in app development?

    Could somebody inform me if it is possible to use custom fonts of choice when developing an app. If so are there any restrictions? I have read that sinds OS 3.2 iPhonesupports custom fonts, ttf and otf  fonts. Is this not the case also  for the ipad? Or am I completely off track?
    If one can add custom fonts do they work along the same lines as embedded webfonts, availale for all users even if they are not  on their ipad?
    I am a media design lecturer looking for correct info for my students who are doing the visual design voor an app.
    Thanks in advance.
    Toronot00

    Hi William
    I found one error. In the skin file, I had added a dependency to my css. It was missing a slash (/) to point to the correct folder level. Now that I've added that, the TOC displays the same font as the Index, Search results, and the topic (content, breadcrumbs, and footer). So, that's good, but on closer inspection, it looks like Verdana, not my custom font.
    I changed the font in whthost.js to the name of my custom font and generated the help, but it made no difference. I also changed the font and just opened the help without generating and got the same results.
    For your second suggestion, you mean whtdhtml.htm not whtdhtml.js? The custom font is in the lines:
    setFont("Normal", "MyFont","10pt","Black","Normal","Normal","none");
    setFont("Hover", "MyFont","10pt","#004080","Normal","Normal","underline");
    I added the <font> tag to this file, but the tag just shows up as plain text within the webhelp TOC (no matter where I insert it in the file).
    I also tried changing the font to my custom font for the Index body and Search results using the steps in Rick's Skinny on Skins (editing the whibody.htm and whfbody.htm files). When I do this, the serif font appears in the Index body and Search results.
    It seems like the files cannot "see" my custom fonts (which are in a folder at the same level as my css).
    Deborah

  • HOW TO: using custom fonts in native storyboard views from an ANE on iOS

    Hey,
      In our apps, we have embedded storyboards into an ANE, and successfully used those screens in an AIR app, and figured out how to use custom fonts in those views.
      I wrote a quick blog post about it and just thought I'd share it real quick in case it helps someone.
    ANE for iOS with Custom Framework – Using Custom Fonts | khef.co

    Hi WayHsieh,
    >>can I just "install" fonts through Word App? Does Word Apps have enough privilege to install fonts on Windows? Can I just click a button in Word App, and then it will install fonts automatically?<<
    Based on my understanding, it is hard to achieve the goal. Because the app webpage is hosted inside an Internet Explorer control which, in turn, is hosted inside an app runtime process that provides security and performance isolation and it is under
    low-Integrity level.
    Here is the figure for apps for Office runtime environment in Windows-based desktop and tablet clients:
    You can get more detail about Privacy and security from links below:
    Privacy and security for apps for Office
    Hope it is helpful.
    Regards & Fei
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • What is the best way to add and use custom fonts with Eloqua?

    We have a custom font that we'd like to use with Eloqua and were wondering how others might have successfully approached this.

    ~~Disclaimer: This answer refers to email fonts only - landing page font imports are discussed below~~
    Hi Brett,
    I took a look at these two posts: Re: Tips for getting the E10 email editor to change the email font for Outlook & other old-school email clients? and Re: E10 Fonts
    It seems that there are reasons as to why only a few of the fonts are supported. You can drill down into the source code to edit the font type, but I'm not sure that will get you anywhere.
    To drill down:
    To get the desired font & size in various clients (Gmail, Hotmail, Yahoo, Outlook) I found that specifying in the html works best.
    So whether it’s a P or TD, tag I add the style attribute & specify the font along with color & size.
    e.g.:
    <td style="LINE-HEIGHT: 18px; FONT-FAMILY: Arial, Helvetica, sans-serif; COLOR: #000000; FONT-SIZE: 12px;">
    Of course if you use the WYSIWYG editor you will have to view the html source & add this.

  • Using custom fonts in iBooks Author

    I have a book in South Asian (Indic) script. The encoding is Unicode. I wanted to see how different fonts would look on iPad. Using iBook Author i created two different versions of the book. One used Gujarati MT, Apple supplied font. The second used open source TTF font. It checked out fine by MacOS when I installed it. The rendering of conjuncts (which would use additional glyph present in the font file) on iBook Author  looks good. When I use "preview" function of iBook Author to see how the content would look on iPad, conjuncts dont use special glyph but only standard character (I guess GSUB is not utilized). I tried the same experiment with Arial Unicode MS and Shruti both are standard fonts provided under Windows. it appears that only Apple supplied fonts have correct glyph substitution on iPad.
    Is there a way to fix it?
    If the issue is with iBook Author, I can use another software. My book is plain text so Author is an overkill. I was using it to test embedding of custom fonts because Author is easy to use.
    If the issue is missing definition in the font that is required by iPad rendering engine, I can get the font author to enhance the font.
    I attach four images. First two are from iBook Author where rendering is correct. The next two are from iPad where rendering using non Apple font is messed up.

    rajeshfrompalo alto wrote:
    Is comment about enhancing the font to support AAT still relevant? Are you saying that iOS needs those AAT extension that macOS does not need? Is this mostly around MORX table?
    iOS (and OS X) comes with two Gujarati fonts, Gujarati MT and Gujarati Sangam MN.  So the easiest thing to do is to use one of those.   Other platforms will probably have their own default Gujarati fonts with different names.
    If you want to embed a different Gujarati font in your .ibooks format book, then you will indeed have to convert that font from OpenType to AAT before iBooks will display it correctly.   It's not true that OS X no longer needs AAT Indic fonts -- Pages for example still cannot use Opentype Indic fonts.
    To convert an Opentype Indic font to an AAT Indic font I think someone will have to add a morx table along the lines of what is contained in Gujarati MT.
    Bear in mind that iBooks Author creates a format that can only be read on an iPad (unless you want to export to PDF).  If you want to produce books for all platforms and readers, then you need to use .epub format and a different app, like Pages or Indesign.   With epub format you would probably not normally try to embed fonts but just  rely on the reader to supply whatever Gujarati font is already on the device.

  • Crash when using custom font

    I'm trying to use FontAwesome for its neat icons, and started off by doing this:
    @Override
    public void start(Stage primaryStage) {
        Label label = new Label("\uf067\uf044\uf014");
        label.setFont(Font.loadFont(getClass().getResourceAsStream("/resources/fonts/awesome.otf"), 28));
        StackPane root = new StackPane();
        root.getChildren().add(label);
        Scene scene = new Scene(root, 300, 250);
        primaryStage.setTitle("Custom Font");
        primaryStage.setScene(scene);
        primaryStage.show();
    }This code seems to work, except for the following problems:
    * Only the bottom left part of each icon is shown.
    * When I close my application, Java crashes with the following error:
    Process: java [838]
    Path: /Library/Java/JavaVirtualMachines/jdk1.7.0_10.jdk/Contents/Home/bin/java
    Identifier: java
    Version: 1.0 (1.0)
    Code Type: X86-64 (Native)
    Parent Process: java [737]
    User ID: 501
    Date/Time: 2013-01-04 14:21:46.619 +0100
    OS Version: Mac OS X 10.8.2 (12C60)
    Report Version: 10
    Interval Since Last Report: 229291 sec
    Crashes Since Last Report: 7
    Per-App Crashes Since Last Report: 6
    Anonymous UUID: 26E79257-64B7-7EBA-1423-94B8139F71D1
    Crashed Thread: 25 Java: Thread-6
    Exception Type: EXC_CRASH (SIGABRT)
    Exception Codes: 0x0000000000000000, 0x0000000000000000
    Application Specific Information:
    Assertion failed: (t->numPointers == 0), function tsi_DeleteMemhandler, file src/tsimem.c, line 89.
    (and so on ... I can't post the complete error message here because the forum won't allow a post that long)
    Does anyone have any idea what's happening here, or should I just file a bug ?
    I'm using JDK 7u10 on Mac OS 10.8.2

    This seems to work fine when I use TTF instead of OTF.
    I will file it as a bug.

  • Slow Operation of IM Using Custom Font

    I use a variation of this command in an application, and it has run sufficiently fast for years. However, with the current version of ImageMagick, it is extremely slow when I use a custom font (causing the application to hang disconcertingly). No errors are thrown, even with the -verbose tag. Does anyone know why IM is now so slow operating on a custom font, and if there is anything I can do to optimise the operation? Thanks.
    With no font specified, this command runs in a tenth of a second:
    [tony@linux ~]$ start=$(date +%s%3N) ; convert -pointsize 24 caption:"Lorem ipsum dolor sit amet" pic.png ; echo `expr $(date +%s%3N) - $start` ms
    118 ms
    With a custom font specified, the same command takes almost five seconds:
    [tony@linux ~]$ start=$(date +%s%3N) ; convert -font /usr/local/share/fonts/c/code2000.ttf -pointsize 24 caption:"Lorem ipsum dolor sit amet" pic.png ; echo `expr $(date +%s%3N) - $start` ms
    4650 ms
    Last edited by tony5429 (2014-10-12 19:06:50)

    No ideas on this issue?

  • Photoshop will only let me use custom font sizes

    Hello
    I've been having a strange issue for awhile that I thought would eventually go away with an update but hasn't. Having used photoshop for years, I've always been able to click in the text size menu of the character panel and either type in a pt size or increment larger or smaller with my up and down arrows on the keyboard. I can no longer do that -- when I try to type in the new font size -- say 25 -- my text is actually replaced with the numbers "25" and the font size stays the same. If I choose a default size from the drop down menu (18, 24, 36, 48, etc) it will change size but I'm not able to enter any custom sizes. I get the same behaviour in the option bar.
    I'm using the most up to date version of CC on an late 2012 Imac 2.9 GHz Intel Core i5 running the most recent version of Mavericks ( OS X 10.9.2 (13C64)), but this has been happening since Mountain Lion and atleast the first version of CC, possibly CS6.
    It doesn't matter what font I use and happens on every document. I've also tried to reset the tools and delete the preferences.
    I do use the no-longer -supported free version of Linotype Explorer but it seems more like a photoshop issue.
    This is obviously really frustrating and I haven't been able to find anyone else with the exact problem. If anyone has any ideas I'd really appreciate it.
    Thanks!

    The key combos still work for changing type point size, just not in Preferences-controlled-increments (instead, whole point sizes, 1 point at a time) -- and you can also input any point size. Are you using the Character Palette?
    On Mac, "Command-Shift->" increases the point size 1 point, and "Command-Shift-<" reduces it by 1 point size (if the type is selected).
    If you use the Character Palette (Command-T on Mac), you can input any point size you want, up to 1/1000th of a point: 24.582 pt. size, for example.

  • Importing custom fonts into iPhone apps - HELP?!

    Hey guys, new to these forums. Just wondering if somebody could answer a few questions regarding successfully importing and using custom fonts into iPhone applications. As shown here,
    http://forums.macrumors.com/showthread.php?t=569311
    http://discussions.apple.com/thread.jspa?threadID=1447085
    http://stackoverflow.com/questions/360751/can-i-embed-a-custom-font-in-an-iphone -application
    some have shown success in doing just that. To those who have done it, what i wanted to simply ask is:
    What type of subclass did you put the code in? Mines is a UIView subclass but doesnt work.
    What kind of interface and with what controls are you using? I am simply making a UIView with the code in order to test to see if it works and test other properties and customizable functions of the custom fonts. It doesnt work.
    What specific property declarations must be in the .h file? I have none and it doesnt work.
    Note that when I say it doesnt work, it actually compiles without errors, but when I build and go I just get a blank grey screen.
    What say you?

    To use Stanza you need Stanza's desktop client in order to get your books onto the iPhone. If you have an account with eReader.com, you can upload personal content to your bookshelf and transfer them to eReader on your iPhone in the same way you do books purchased from eReader's website. Keep in mind that neither will work with MobiPocket books that are DRM protected. Stanza will work with non-DRM formatted books (including Mobi's format), but nothing which has DRM protection. I have both and use Stanza for anything without DRM protection, and eReader for books Palm formatted books with DRM protection.

  • IWeb 08 - Custom Fonts not loading Anymore

    All,
    When I had iWeb '06 installed I could use custom fonts when designing and the fonts would display on any computer without having to install them. It seems that iWeb '06 used to load them as images.
    Now in iWeb '08 that doesn't seem to be the case. Now you have to have the fonts on your system to view them. Anyone know a way in '08 to change this. Or should I just create those portions as images then add them to the page?
    Thanks to all who respond.

    HI phantom27,
    While in iWeb, go to iWeb help and type in fonts in the search box.
    In the results page, look at the bottom where it says "iWeb:Tips for making text appear consistant in all browsers. It will give you all the info you need.

  • Custom font not exported in PDF

    Hello Guys,
    In my web application, I have a crystal report developed in CR11 R2 SP3. The report uses custom font and it works fine when shown in report viewer.
    However I get errors while exporting report as PDF.
    1) In windows 2003 server, the pdf is exported without the font values.
    2) In Windows XP, pdf is not exported at all and I get an error:
    Error in File C:
    WINDOWS
    TEMP
    CrystalReport1 {6A26233D-4832-44B1-AC8E-A21421F6A2E4}.rpt:
    Error detected by export DLL.
    Can anybody please help. One more thing. The custom font is fine and has been working fine in other crystal report based applications.
    Thanks,
    Shahzad

    Ok, two suggestions:
    A)
    1) On your web app that throws the error, place label and a text box on your web form
    2) Use the custom font for the label and in the text box
    3) Run the app
    Does that work?
    B)
    If it does, I'd recommend using filemon and regmon utilities to fins out what is failing. Filemon can be found here:
    http://www.microsoft.com/technet/sysinternals/utilities/filemon.mspx
    Regmon is here;
    http://www.microsoft.com/technet/sysinternals/utilities/regmon.mspx
    Instructions on how to use the above:
    1) Load Filemon
    2) Press Ctrl + L. This will bring up the filter window.
    3) In the 'include' text box, put the name of the aspnet worker process, without the full path. ie: aspnet_wp.exe (ok)
    4) Click <OK>
    5) Press Ctrl + X to clear the display.
    6) run your application, get it to the point where it errors.
    7) Save the filemon log. File -> Save as
    8) Look for files where the 'result' column is not successful.
    Regmon
    Here is how to use it:
    1) Load Regmon
    2) Press Ctrl + L. This will bring up the filter window.
    3) In the 'include' text box, put the name of the aspnet worker process, without the full path. ie: aspnet_wp.exe
    4) Click <OK>
    5) Press Ctrl + X to clear the display.
    6) run your application, get it to the point where it errors.
    7) Save the Regmon log. File -> Save as
    8) Look for files where the 'result' column is not successful.
    Ludek

  • Keynote to ipad, with custom fonts and graphics

    Have a keynote presentation we've spent a lot of time on.
    Custom fonts, graphics.
    I've given up trying to import it into keynote on the iPad. Fonts alone are a big issue.
    So, trying converting it to quicktime, but then it plays as a movie, there is no simple, elegant solution to pause, or tap through the presentation.
    Or, am I missing something?!
    Appreciate any help.
    Charles

    Hi, i found this "solution".
    It's impossible to upload new fonts on iPad, but you can convert your slides in pictures and upload your new presentation on iPad.
    I dont' like it ... but it's the one way i found.
    http://cursorgaze.com/using-custom-fonts-on-keynote-for-ipad-and-slideshare/

  • Customer fonts

    Is it possible to use customer fonts in pdf and rtf reports generated by BI Publisher
    Thanks
    Kevin

    yes, you can use custom fonts (see bip documentation). I have to warn you though, they really should be true type fonts, especially for post script printers. You may need to setup pasta and pdf2ps
    Ike Wiggins
    http://bipublisher.blogspot.com

  • Some Text Messages do not display when using large font on iphone

    When using increased font size (accessability function) on iphone some text messages will not display. The iphone just seems to lock up. If normal font size is used text massage displays with out any issue. When font size is increased, text message will not display again.

    Hi Peter
    Actually, Captivate does have an essentially unlimited number
    of undo levels. But that number may appear to be different. The
    number of levels starts when you begin editing the project. If you
    close and re-open a project, that starts the undo process over.
    I've tested and I gave up after about 280 or so undos.
    Where Captivate doesn't allow an undo, it normally warns you
    with a rather catastrophic looking dialog.
    Cheers... Rick

Maybe you are looking for

  • AVC to MP4 converter

    I need to convert AVC files to MP4 files. Does anyone know of the easiset way to do this?

  • Make header links in PPR report region

    I have a tabular form, and for several headers, I created a popup help page, and call the popup with a javascript function in the header. The html for my headers in the Report Attributes is as follows: <p> <a title="Click for RAC Explanation" href="j

  • HT5243 For the Mac OS X 10.6 Update 8, How Do We Know...

    Hello- I am wondering how one knows if they should install the new Update for Mac OS X 10.6 Update 8?  It says, "If you do not use Java applets, you should disable the Java web plug-in your web browser," which is Safari for me. Is this an update I sh

  • Creating scorecard without performance management plan

    Hi guys, I was wondering if it is possible to create a scorecard for a user and have the manager set objectives for him e.t.c without a performance management plan. I created a scorecard using the HR_PERSONAL_SCORECARD api for a user and set the plan

  • ABOUT SOFTWERE UPDATE

    IAM USING IPHONE4 AND NOW IAM UPDATE IT TO IOS 7.1.2 AND NOW THE ACTIVATION IS FAILED IT SAYS THE INSERT CARRIER SUPPORTED SIM SIM