Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-13720] CLI: iOS: /Resources/fonts/ directory is ignored with new tiapp.xml <ios> directive

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionFixed
Resolution Date2013-05-20T22:00:23.000+0000
Affected Version/sRelease 3.1.0
Fix Version/sn/a
ComponentsCLI
Labelsdocumentation, regression
ReporterShannon Hicks
AssigneeChris Barber
Created2013-04-08T15:18:42.000+0000
Updated2017-03-21T19:06:05.000+0000

Description

*Problem description* If you have a /Resources/fonts/ directory with custom fonts in it, and define those fonts in tiapp.xml 's new directive, the fonts directory is not copied over to the build. *Test case*
    <ios>
        <min-ios-ver>4.3</min-ios-ver>
        <plist>
            <dict>
                <key>UIStatusBarStyle</key>
                <string>UIStatusBarStyleBlackOpaque</string>
                <key>UIAppFonts</key>
                <array>
                    <string>/fonts/MyFont_1.otf</string>
                    <string>/fonts/MyFont_2.ttf</string>
                </array>
            </dict>
        </plist>
    </ios>
*Workaround* If you copy the fonts/ directory to /platform/iphone/ and /platform/android/ they are included in the build.

Comments

  1. Daniel Sefton 2013-04-29

    Just some thoughts if you're around before we test this... So if you *don't* define those fonts with UIAppFonts, the Resources/fonts/ directory is copied to the build as expected? I'd think this is expected behavior anyway, since the directive is platform specific, so any folders it references will be platform specific. I can see the need for a global fonts folder though. You also mention the Android directory - does it not copy it on Android either?
  2. Shannon Hicks 2013-04-29

    According to the docs ([http://docs.appcelerator.com/titanium/latest/#!/guide/Custom_Fonts]), you need a custom info.plist... I would have assumed that using the new directive would supersede that. If the new expected behavior is to not do anything other than have a "fonts" directory, the docs should say this (and this ticket should be a Docs issue). I'm afraid I don't have my project up at the moment, so I can't provide quick answers to your questions.
  3. Daniel Sefton 2013-04-29

    I'm 99% sure it's expected behavior that you should include the fonts directory in the /iphone directory anyway. Do you have any problems with this? About the docs... So you'd like the docs to be updated to describe adding fonts with the new directive (and of course cover the fact that the fonts directory should be included in the platform specific folders)?
  4. Shannon Hicks 2013-04-29

    Well, the bottom line is that we need accurate instructions on how to use custom fonts, regardless of what those instructions are. You've now mentioned a second "expected", yet undocumented behavior... the need to put fonts in the /iphone directory. [Using the custom font](http://docs.appcelerator.com/titanium/latest/#!/guide/Custom_Fonts-section-29004935_CustomFonts-Usingthecustomfont): {quote} 2. Copy the TTF/OTF file to the Resources/fonts/ directory. If you want to use different fonts on iOS than Android, you can copy those files to Resources/iphone/fonts and Resources/android/fonts instead. {quote} So, if the documentation is all wrong, then it needs to get fixed in 3.1.1. If there's an actual Ti SDK bug, well, ditto.
  5. Daniel Sefton 2013-04-29

    Ah I see. I'll get our team to look at it from the platform side first. Thanks.
  6. Chris Barber 2013-05-20

    This has been fixed by TIMOB-13859. In TIMOB-13859, there was a bug with files not being symlinked properly, some files being copied twice, and some files not copied at all. Turns out that the fix for TIMOB-13859 also fixes this ticket. :) TIMOB-13859 was merged into master and 3_1_X and will be available in 3.1.1.GA.
  7. Lee Morris 2017-03-21

    Closing ticket as fixed.

JSON Source