iOS 7 NSLineBreakByCharWrapping wrapping at wrong characters - layout

I just ran into trouble with iOS 7. I want to set the lineBreakingMode for a UILabel in a UITableViewCell to NSLineBreakByCharWrapping.
My code looks like this:
self.textLabel.lineBreakMode = NSLineBreakByCharWrapping;
self.textLabel.numberOfLines = 0;
In my strings special characters like ! $ & appear but I never use any kind of whitespace.
Now I recognised that iOS6 display everything correctly. The text fills the whole line and is wrapped at any character.
In iOS7 the text is wrapped at special characters (! $ &). However sometimes it looks like iOS7 breaks the lines correct.
I attached three screenshots showing the results in iOS6 and 7.
Anyone got an idea whats wrong with this?
iOS6 (ok):
iOS7 (ok)
iOS7 (wrong)

Related

How to add padding to title in `matplotlib.animation`?

I created an animation using python matplotlib.animation library and I'm quite happy with it. The output is
The only part I'm unhappy with is the title. As you can see it "jiggles" around. The update function in the animation looks like this
def update_curves(num):
# do stuff with data to get lines
title.set_text('September 5th, 1994 at 00:00h\n + {}y {}d'.format(int(time[num]/365),int(time[num]%365)))
return title, lines
Is there a way to stop the y and d from moving around?
I tried searching SO for info on how padding might work but I haven't really seen something that is compatible with matplotlib.animation. Using tabs also doesn't work since they don't get displayed properly...
You can do this using good old string formatting:
title.set_text('September 5th, 1994 at 00:00h\n + {:3}y {:5}d'.format(int(i), int(i*20)))
title.set_family("monospace")
{:3} formats the string so that it is exactly 3 characters long, and is left padded with spaces.
If you use the normal serif/sans-serif font, you will still have some jitter since each digit/letter is not equal in width, but set the font family to monospace and it works correctly.

ncursesw on actual svga console colors are not correct

I'm using ncursesw which does output some cchar_t items, everything works fine from a terminal opened in a GUI, but when on the actual PC console, the colors are off (standard simple colors) for some of the items and those do use setcchar(&cch, wch, WA_NORMAL, 0, NULL) and add_wch(&cch). The color to use is set on the window using wattrset and wbkgdset prior to the setcchar call. Is there a limitation using the wide chars (cchar_t) when dealing with a normal PC console? What would that rule be?
It turns out there was another routine that set the colorpair using setcchar and the actual attribute was used instead of the color pair number. So while some terminals must account for that, the console didn't. The proper value for setcchar is the color pair number (n) and not the result of COLOR_PAIR(n)

SSRS display Georgian and Armenian script

I am running a test on an SSRS report to ensure that any data the user enters can be displayed correctly. The query contains the following string as nvarchar:
ربيالأردбъл (Бъля)àčދިވެހިބަސްΕλλάñøગુજરાहिं 日本ქაಕನ್ನಡ한국कोंकКमराठीसंस्कृतБосна и Херцеговина)ไทยاُردو中文(简体)фхцчшщ
In the text box where this is displayed in the report, most of this displays properly. However, there are two small portions which do not: Հայ, which is Armenian text; and ქა, which is Georgian. These two display rectangles instead of the characters, as if it cannot display those characters. Does anyone know how I can get it to display these characters properly like the rest of the string? Thanks!
In case anyone else needs an answer to this, it turned out not to be anything with the compiler or SSRS, but just the font. Arial, it seems, doesn't support those characters. I switched the font to Arial Unicode MS, which looks the same but has the characters supported, and that fixed characters.

Text/font spacing in TextLayer

I started to write my own watch face. I have problem with font spacing. I'm using custom .ttf font and my problem is that "1" and "9" digit does not have same width. When hour/minute changes from 1 to something different, whole text move. I don't know what to do with it.
I have 3 ideas to handle this problem :
- use png images of digits instead of font (more space needed, harder)
- take every digit as a single TextLayer (to display "00:00" I would need 4 TextLayers)
- some function build-in already - tried to find but without luck
I'm writing it in C.
Thanks,
Peter.
I downloaded some other watch faces and tried to play with them. Problem was with font, not my app. I used "FontForge" to modify width of "1" in font I want to use. Now everything is working fine without splitting etc..

display.newText wont draw to screen in Lua

Looking through a few questions and answers i still am unable to find out what is wrong...
local myTextObject = display.newText( "Hello World!", 160, 240, "Arial", 60 )
This line of code - directly from the Corona Docs Guide is not displaying any text within my simulator. trying to figure out the problem i created a blank project and copy pasted this code and still nothing happens despite it being the only thing within the file.
Checking through iv used differnt fonts, used differnt methods of handling the string and still nothing will appear within the Corona Simulator - Even updating the SDK still doesnt solve this issue.
What am i doing wrong :S
thanks
local myText = display.newText( "Hello World!", 100, 200, native.systemFont, 16 )
myText:setFillColor( 1, 0, 0 )
Paste this code in the main.lua. Try this out it must work for sure.
Have you tried changing the font color?
text:setFillColor (200/255,0/255,2/255)
You said that you create a blank project so, Im expecting it as a black background, and creating text without changing the font color will make it look that it doesn't show any text

Resources