kerning

Differing char spacing in a WPF RichTextBox

我们两清 提交于 2019-12-11 06:32:48
问题 I have a custom control I have made. It extends a RichTextBox. I have code that sets the width of the Document so that the number of chars is limited. (I am using Courier New, so I have a fixed width font.) This all works fine. But once I put the control in my application, the limit starts failing. After comparing the two, I noted that the spacing between my test application and my real application is different. Here is an example: As you can see my spacing for the Test App is larger than the

NSString drawInRect:withAttributes: not correctly centered when using NSKernAttributeName

白昼怎懂夜的黑 提交于 2019-12-06 05:48:21
问题 When I use drawInRect:withAttributes: and pass in both a paragraph style with NSTextAlignmentCenter and a non-zero value for NSKernAttributeName , the string does not get centered correctly. Am I doing something wrong or is this expected behavior? Is there a workaround? Screenshot: You can clearly see that top text is not centered correctly. My demo code: - (void)drawRect:(CGRect)rect { // Drawing code UIFont *font = [UIFont systemFontOfSize:15.0]; [self drawString:@"88" inRect:rect font:font

Bad character spacing (kerning) in JavaFX's font rendering (in Linux)

被刻印的时光 ゝ 提交于 2019-12-06 03:56:03
问题 I've started developing an application in JavaFX and I've run in an issue, I could find very little helpful information about: The spacing of between characters in Linux is very uneven. I'm not talking about the width of different characters but of the spaces between the characters. It's visible in normal text, but the following example illustrates the effect better than normal text. Take a look at the first row. The space between the first two characters is smaller than between the second

Obtaining kerning information

☆樱花仙子☆ 提交于 2019-12-05 12:24:07
How can I obtain kerning information for GDI to then use in GetKerningPairs ? The documentation states that The number of pairs in the lpkrnpair array. If the font has more than nNumPairs kerning pairs, the function returns an error. However, I do not know how many pairs to pass in, and I don't see a way to query for it. EDIT #2 Here is my fill application that I have also tried, this is always producing 0 for any font for the number of pairs. GetLastError will always return 0 also. #include <windows.h> #include <Gdiplus.h> #include <iostream> using namespace std; using namespace Gdiplus; int

How to set kerning (spacing between characters) on UINavigationBar title - Swift or Objective-C

这一生的挚爱 提交于 2019-12-04 17:26:51
问题 I've got my nav bar mostly customized to my liking, but I'm trying to increase the kerning using NSKernAttributeName . I'm using the appearance proxy to set the nav bar to white text and a custom font, but when I try to add kerning it doesn't take effect. [[UINavigationBar appearance] setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys: [UIColor whiteColor], NSForegroundColorAttributeName, [UIFont fontWithName:@"HelveticaNeue-Light" size:20.0], NSFontAttributeName, [NSNumber

Bad character spacing (kerning) in JavaFX's font rendering (in Linux)

久未见 提交于 2019-12-04 08:49:24
I've started developing an application in JavaFX and I've run in an issue, I could find very little helpful information about: The spacing of between characters in Linux is very uneven. I'm not talking about the width of different characters but of the spaces between the characters. It's visible in normal text, but the following example illustrates the effect better than normal text. Take a look at the first row. The space between the first two characters is smaller than between the second and third. This also happens between the sixth and seventh character and several others: Swing does not

Cannot get the kerning of some specific .ttf fonts with freetype

醉酒当歌 提交于 2019-12-04 04:39:33
I am trying to extract kerning information out of some .ttf fonts with freetype 2.6 library. This is how I get kerning informations (looping through characters): if( FT_HAS_KERNING(face->getFace()) && previous ){ FT_Vector delta; FT_UInt glyph_index = FT_Get_Char_Index( face->getFace(), character ); FT_UInt prev_index = FT_Get_Char_Index( face->getFace(), previous ); FT_Get_Kerning( face->getFace(), prev_index, glyph_index, FT_KERNING_DEFAULT, &delta ); kerning = delta.x >> 6; } I tried the program with some different fonts: "Times new roman.ttf", "Tymes.ttf", "minion.otf". For Times new Roman

How do you adjust text kerning using Interface Builder in Xcode 7?

不羁的心 提交于 2019-12-03 11:36:11
There are a myriad of settings for NSAttributedParagraphStyle that I can see in Interface Builder: But none of these are for text kerning. Is there a way to adjust the text kerning in Xcode 7's Interface Builder for attributed text? (Please don't answer with how to do this in code - I already know how to do that!) You can actually do this without the use of a subclass through an extension. import UIKit @IBDesignable extension UILabel { @IBInspectable public var kerning:CGFloat { set{ if let currentAttibutedText = self.attributedText { let attribString = NSMutableAttributedString

How to set kerning (spacing between characters) on UINavigationBar title - Swift or Objective-C

微笑、不失礼 提交于 2019-12-03 10:20:08
I've got my nav bar mostly customized to my liking, but I'm trying to increase the kerning using NSKernAttributeName . I'm using the appearance proxy to set the nav bar to white text and a custom font, but when I try to add kerning it doesn't take effect. [[UINavigationBar appearance] setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys: [UIColor whiteColor], NSForegroundColorAttributeName, [UIFont fontWithName:@"HelveticaNeue-Light" size:20.0], NSFontAttributeName, [NSNumber numberWithFloat:2.0], NSKernAttributeName, nil]]; Do I need to do something else to add some of the less

WPF's TextBlock differences between Windows 7 and Windows 8

强颜欢笑 提交于 2019-12-02 05:51:05
问题 While investigating some unit tests which fail only on my machine, I noticed that TextBlock presents text differently on Windows 7 and Windows 8 machines. To inspect the issue, I created sample application containing just one TextBlock: <Window x:Class="WpfApplication1.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" Height="350" Width="525"> <Grid> <TextBlock Text="yo" FontSize="100"