Robert Valentino Well-Known Member Licensed User Longtime User Jan 3, 2016 #1 I have labels that were made in Designer with a Typeface of MONOSPACE Style ITALIC When I create a New label on a panel I am displaying in ScrollView2D and assign it a typeface of Code: Copy Typeface.CreateNew(Typeface.MONOSPACE, Typeface.STYLE_ITALIC) It appears as MONOSPACE but does not have the ITALIC style Is designer doing something different in its label creation? The code for the label I create is as follows: Code: Copy Dim AnotherPlayer As Label AnotherPlayer.Initialize("") AnotherPlayer.Gravity = Gravity.LEFT + Gravity.CENTER_VERTICAL AnotherPlayer.Typeface = Typeface.CreateNew(Typeface.MONOSPACE, Typeface.STYLE_ITALIC) AnotherPlayer.TextSize = 16 Which matches exactly what I have in the labels I create in Designer. Why is the ITALIC style not taking effect? BobVal
I have labels that were made in Designer with a Typeface of MONOSPACE Style ITALIC When I create a New label on a panel I am displaying in ScrollView2D and assign it a typeface of Code: Copy Typeface.CreateNew(Typeface.MONOSPACE, Typeface.STYLE_ITALIC) It appears as MONOSPACE but does not have the ITALIC style Is designer doing something different in its label creation? The code for the label I create is as follows: Code: Copy Dim AnotherPlayer As Label AnotherPlayer.Initialize("") AnotherPlayer.Gravity = Gravity.LEFT + Gravity.CENTER_VERTICAL AnotherPlayer.Typeface = Typeface.CreateNew(Typeface.MONOSPACE, Typeface.STYLE_ITALIC) AnotherPlayer.TextSize = 16 Which matches exactly what I have in the labels I create in Designer. Why is the ITALIC style not taking effect? BobVal
stevel05 Expert Licensed User Longtime User Jan 4, 2016 #2 It works OK for me on a standard label directly on the Activity, Android 6.0.1 Asus Nexus 7. I don't have the Scrollview2d library installed to try it on though. Last edited: Jan 4, 2016 Upvote 0
It works OK for me on a standard label directly on the Activity, Android 6.0.1 Asus Nexus 7. I don't have the Scrollview2d library installed to try it on though.
klaus Expert Licensed User Longtime User Jan 4, 2016 #3 The problem must be somewhere else. Because it works here too, in a ScrollView2D on my Sony xperia z1 with Android 5.1.1. Upvote 0
The problem must be somewhere else. Because it works here too, in a ScrollView2D on my Sony xperia z1 with Android 5.1.1.
Robert Valentino Well-Known Member Licensed User Longtime User Jan 4, 2016 #4 Just to make sure we are trying the same thing. 1) I have a panel (PanelX) created in designer (that has labels with typeface Monospace / Style Italic 2) Add this PanelX to a ScrollView2D 3) Add a label field to the to PanelX (with typeface Monospace / Style Italic) I've added fields in other places without any problems - but in this case the "Italic" part of the typeface isn't taking. The font looks like Monospace but not Italic Upvote 0
Just to make sure we are trying the same thing. 1) I have a panel (PanelX) created in designer (that has labels with typeface Monospace / Style Italic 2) Add this PanelX to a ScrollView2D 3) Add a label field to the to PanelX (with typeface Monospace / Style Italic) I've added fields in other places without any problems - but in this case the "Italic" part of the typeface isn't taking. The font looks like Monospace but not Italic
M mberthe Member Licensed User Longtime User Jan 4, 2016 #5 I had exactly the same problem : I have not found a solution with the tyface property: I used a richstring to display the text of the label in bold Upvote 0
I had exactly the same problem : I have not found a solution with the tyface property: I used a richstring to display the text of the label in bold
Robert Valentino Well-Known Member Licensed User Longtime User Jan 5, 2016 #6 Understood, I have a way around it (I created extra fields in designer that I have hidden and un-hide them and move into position when needed) But this seems like a sure bug to me. Upvote 0
Understood, I have a way around it (I created extra fields in designer that I have hidden and un-hide them and move into position when needed) But this seems like a sure bug to me.
klaus Expert Licensed User Longtime User Jan 5, 2016 #7 You should post a small project showing the problem. So we could see what exactly you have done and how and test it in the same conditions as you do. Upvote 0
You should post a small project showing the problem. So we could see what exactly you have done and how and test it in the same conditions as you do.
Robert Valentino Well-Known Member Licensed User Longtime User Jan 5, 2016 #8 Shouldn't be hard will do within next few days Upvote 0
Robert Valentino Well-Known Member Licensed User Longtime User Jan 7, 2016 #9 The Fields in Yellow were created in Designer and the Field in Red was created in code. ALL use Monospace and Style or ITALIC or BOLD_ITALIC but the Italic option does not seem to be working Included test code example If it matters I am using a Samsung Galaxy Tab-3 (SM-T210R) Attachments TestCodeSV2D.zip TestCodeSV2D.zip 10.9 KB · Views: 557 Upvote 0
The Fields in Yellow were created in Designer and the Field in Red was created in code. ALL use Monospace and Style or ITALIC or BOLD_ITALIC but the Italic option does not seem to be working Included test code example If it matters I am using a Samsung Galaxy Tab-3 (SM-T210R)
stevel05 Expert Licensed User Longtime User Jan 8, 2016 #10 The app works as expected on my Asus Nexus 7. Just running it, I get Bold Italic font in blue for data in the NewPlayer box. Upvote 0
The app works as expected on my Asus Nexus 7. Just running it, I get Bold Italic font in blue for data in the NewPlayer box.
klaus Expert Licensed User Longtime User Jan 8, 2016 #11 Strange! It works fine on my Sony xperia z1, Android 5.5.1 But it doesn't show italic on my Asus TF 700T, Android 4.2.1 It seems that the problem is Android and/or device dependant. Upvote 0
Strange! It works fine on my Sony xperia z1, Android 5.5.1 But it doesn't show italic on my Asus TF 700T, Android 4.2.1 It seems that the problem is Android and/or device dependant.
M mberthe Member Licensed User Longtime User Jan 8, 2016 #12 it don't work on samsumg galaxy tab 1 (android 4.0.4 )1 and on asus K011 (android 4.4.2) ...! Upvote 0
Robert Valentino Well-Known Member Licensed User Longtime User Jan 8, 2016 #13 Strange that it always seems to work from designer but not from a APP Maybe we should move this the BUG area? I don't have rights to do this ALSO Klaus: Did you change the FONT size. Because that sure seems a LOT larger then what it should be. BobVal Upvote 0
Strange that it always seems to work from designer but not from a APP Maybe we should move this the BUG area? I don't have rights to do this ALSO Klaus: Did you change the FONT size. Because that sure seems a LOT larger then what it should be. BobVal
stevel05 Expert Licensed User Longtime User Jan 8, 2016 #14 It can't be classified as a bug as it is proven to work as expected on some devices at least, rather it seems to be a difference in manufacturers implementations (again), and there would be nothing Erel can do about it within B4a. If you have a workaround, I suggest that you use that so you know it will work on all devices. This thread will serve as documentation of the issue for anyone else that comes across it. Upvote 0
It can't be classified as a bug as it is proven to work as expected on some devices at least, rather it seems to be a difference in manufacturers implementations (again), and there would be nothing Erel can do about it within B4a. If you have a workaround, I suggest that you use that so you know it will work on all devices. This thread will serve as documentation of the issue for anyone else that comes across it.
klaus Expert Licensed User Longtime User Jan 8, 2016 #15 Robert Valentino said: ALSO Klaus: Did you change the FONT size. Because that sure seems a LOT larger then what it should be. Click to expand... No. But I know why it is bigger. In the Designer you have AutoScaleAll. The layout variant is 999 x 600 scale 1. My device is 1080 x 1920 scale 3 which means 640 x 360 scale 1 sothe text size is downscled. Below an image without AutoScaleAll. Upvote 0
Robert Valentino said: ALSO Klaus: Did you change the FONT size. Because that sure seems a LOT larger then what it should be. Click to expand... No. But I know why it is bigger. In the Designer you have AutoScaleAll. The layout variant is 999 x 600 scale 1. My device is 1080 x 1920 scale 3 which means 640 x 360 scale 1 sothe text size is downscled. Below an image without AutoScaleAll.
Robert Valentino Well-Known Member Licensed User Longtime User Jan 8, 2016 #16 As for not being classified as a bug. I beg to differ on that. If we can create labels in designer that work properly on a device then we should be able to do the same thing in code. What / How is designer setting the fields to appear properly that we are not doing in code? If the fields did not appear properly from designer in different devices then I would say this would be a device bug. But I think this is a bug BobVal Upvote 0
As for not being classified as a bug. I beg to differ on that. If we can create labels in designer that work properly on a device then we should be able to do the same thing in code. What / How is designer setting the fields to appear properly that we are not doing in code? If the fields did not appear properly from designer in different devices then I would say this would be a device bug. But I think this is a bug BobVal
stevel05 Expert Licensed User Longtime User Jan 8, 2016 #17 Yes I agree, a bug in the Manufactures implementation. Upvote 0
Robert Valentino Well-Known Member Licensed User Longtime User Jan 8, 2016 #18 If it is a manufactures bug then why can designer create fields that are right? Upvote 0
stevel05 Expert Licensed User Longtime User Jan 8, 2016 #19 Good point but, why does it work on some devices and not others? Perhaps we'll have to leave it to Erel to have a say. Upvote 0
Good point but, why does it work on some devices and not others? Perhaps we'll have to leave it to Erel to have a say.
stevel05 Expert Licensed User Longtime User Jan 8, 2016 #20 Seems like the problem is rife. http://stackoverflow.com/questions/6124440/android-paint-settypeface-isnt-working-for-italic Also has an alternative solution. Upvote 0
Seems like the problem is rife. http://stackoverflow.com/questions/6124440/android-paint-settypeface-isnt-working-for-italic Also has an alternative solution.