Bold and Italic Font Help

Hi there. I’m new to Corona SDK, and I need help making the text italic.

I used a font “Times New Roman Italic.” In the build.settings file, it’s timesi.ttf.
Here’s the code i have:

local lotsOfText27 = “Do you believe the children will discover all of this?”

local lotsOfText27Object = util.wrappedText( lotsOfText27, 45.5, 14, “Times New Roman Italic”, {115,70,30} )
scrollView:insert(lotsOfText27Object)
lotsOfText27Object.x = 24
lotsOfText27Object.y = math.floor(lotsOfText26Object.y + lotsOfText26Object.height)

What I also need to know is how do I align the text to the center, and how to set the text to “justify?” [import]uid: 162639 topic_id: 29173 reply_id: 329173[/import]

obj.align = “center” will center it but I believe that only works on device or xcode sim and not in Corona sim.

For the text not showing as italic, do you have the font installed on your computer and the font file in your project’s root? [import]uid: 52491 topic_id: 29173 reply_id: 117393[/import]

I have the Times New Roman Italic font in both the computer and the project folder. I tried changing it from timesi.ttf to times_new_roman_italic.ttf, an dit still gives me nothing. What do I do? [import]uid: 162639 topic_id: 29173 reply_id: 117424[/import]

Try this;
[lua]test = display.newText(“this is a test”, 10, 10, “TimesNewRomanPS-ItalicMT”, 24)[/lua]

That should show on device I believe but let me know - if still not working include your build.settings file code please.

Peach :slight_smile: [import]uid: 52491 topic_id: 29173 reply_id: 117532[/import]

Tried it. Same results. Just shows the default font. [import]uid: 162639 topic_id: 29173 reply_id: 117561[/import]

Post build.settings code? [import]uid: 52491 topic_id: 29173 reply_id: 117683[/import]

I typed in the name of that font file in the build.settings file, and still the same results.
Here’d the code:
–Chosen Orientations:
–Portrait

settings = {

orientation = {
default = “portrait”,
supported =
{
“portrait”
},
},

iphone = {
plist = {
UIStatusBarHidden = false,
UIPrerenderedIcon = true, --Set to false for “shine” overlay
UIApplicationExitsOnSuspend = true,
UIAppFonts = {
“times.ttf”,
“Kidsn.ttf”,
“timesi.ttf”,
“Times New Roman Italic (TrueType).ttf”,
“timesbi.ttf”
}
}
},
}
[import]uid: 162639 topic_id: 29173 reply_id: 117790[/import]

What kind of device are you testing on? If it’s Apple and you upload a simple cut down sample somewhere and share a link will test it on my end. [import]uid: 52491 topic_id: 29173 reply_id: 117854[/import]

Can you ctr-click on the font file from Finder and do a Get Info and get the actual font name that’s embedded in the font?

That is the string you need to use in Corona.

Android seems to want the font named the same as the font’s internal name.

[import]uid: 19626 topic_id: 29173 reply_id: 117881[/import]

I’m actually testing on an iPhone Simulator. [import]uid: 162639 topic_id: 29173 reply_id: 117897[/import]

On iPhone simulator I’m actually getting timesi.ttf working fine with the code I put above. Can you upload a sample somewhere I might run? [import]uid: 52491 topic_id: 29173 reply_id: 117992[/import]