I have an application, which does XAML over same pattern.
I need know size characters drawn in Silverlight.
I have used for this MeasureCharacterRanges.
Region[] partRegions = tempGraphics.MeasureCharacterRanges(t.Text, font, textRect, stringFormat);
But many characters were drawn in Silverlight another (for example japanese characters).
How can I make something similar to my code?
Thanx in advance for the helping hand.
Related
I am trying to match the "teletext holidays" in the image below (with the white bits connecting all the letters:
I have achieved the following by going to the layers section, right-clicking the text layer, and select “Blending Options.” Then marking the checkbox next to “Stroke.”
Any hints or tips to point me in the correct direction would be appreciated. I appreciate moving the letters within the font closer together will help so will work on that now.
Any help appreciated.
Update:
Made the letters appear closer together. However, using stroke is making the black letters "shrink" in size so think a different solution is required. Thoughts?
With regard to that final image and the black letters appearing smaller. When applying the stroke, tick to indicate that it should be outside and not center or inside
And with helping to ensure that the white parts do meet.... Hmm... Well. Difficult to do the horiztonal stroke without it also applying vertically.
I would agree with others that Illustrator would be better but in Photoshop I might try to duplicate the text, make it all white, put it on the layer behind your main text and manually create a horizontal white pattern.
^ I really hope somebody has a better idea for that last bit though.
Alan,
I would like to help you with this issue. First of all your reference design is designed in adobe illustrator not in photoshop because there is some limitation in photoshop for the stroke feature.
So I would like to suggest you design it in adobe illustrator and not waste your valuable time in photoshop for your desired output.
If you need more help regarding it feel free to contact me at niravmistrydata#gmail.com.
Thank you,
Nirav Mistry
I'm posting this question because I'm in front of some kind of wall there..
I need to be able to condense the text of a label to make it fit but without touching at the font size. Basically, just squeeze the text.
Here an image that should be clearer to understand :
Normal/Condensed Font
I've searched a bit but it's pretty uncommon actually.
I doubt it's possible without modifying the font itself but if anyone has an idea, that would be awesome.
N-B: I'm using VS2015.
When using -[NSString drawInRect:withAttributes:], mainly when using the built-in Helvetica Neue but also with other fonts, the kerning is really bad. However, when the same string is rendered in Text Edit (which uses NSTextView) the kerning is great. Consider these two strings:
For small point sizes, the first case (rendered in Cocoa) is nearly illegible, while the second case (from Text Edit) is much better. I don't think that kerning information is being used at all here. If I apply the NSKernAttribute with a value of 0.0 (which according to the documentation turns off kerning) I get the same result, the one at the top.
I also tried using Core Text with CTLineDraw, but still got the bad kerning. So my question is, is there anything special I need to do to enable kerning in the Cocoa text system? If not, how does NSTextView apply kerning?
The top example is 'tighter' and the bottom one is 'looser' see -[NSTextView tightenKerning], -[NSTextView loosenKerning]. Here Apple is confusingly referring to what everyone else calls 'Tracking' as 'Kerning' ie. a constant amount of additional space (positive or negative) uniformly applied between each glyph, after the 'character advance' specified in the font, to make text appear, well, tighter or looser.
The default 'tightness' or 'looseness' is a property of the rendering engine, not the font, and could easily be different between different OSX versions, apps or UI elements.
In a font, the kerning table is for adjustments to the character advance needed by specific pairs of glyphs, eg, in my hypothetical font: 'AV' is listed as a kerning pair - the 'A' should have a smaller advance when the character following it is a 'V'.
The OSX fonts Helvetica and HelveticaNeue (and many of the other fonts) have no kerning information at all, so you are right that no kerning information is being used in your examples.
If the font has no Kerning info, your question "How do i enable kerning in the Cocoa text system?" doesn't make sense or doesn't mean what you think it means (?).
I am experimenting with a word processor I am making and is curious if it is possible to have floating images or text boxes (not inline with text) in an NSTextView. If that isn't possible what would I have to use to go in that direction?
For images (or arbitrary views, really), you can use an NSTextAttachment and NSTextAttachmentCell. There are a couple of other questions on Stack Overflow about them like NSTextView insert image in between text or Mixing graphics in NSTextView?.
Depending on what you mean by "floating", you might have to develop a custom NSTextContainer.
I'm working on an iPad app that does a simple display of text similar to iBooks.
I would like to display ONLY full paragraphs on each screen (ie, no orphan/widows on a page). Similar to iBooks, I want to allow the user to change the font and font size and continue to keep all lines in paragraphs together. The user will be able to page forward and backwards (just like iBooks).
I've been researching this and can't find a solution for this. I would think that someone has already done this code, but it looks like I'm going to have to figure out the point size of the font and calculate the size of the TextView and then count how many characters, etc etc etc.
Does anyone have a suggestion where I might start to do this?
Thanks a bunch!
Look at the NSString UIKit Addition it has methods for calculating how much space the rendering of string in a give font will take.