我有一个 NSPopUpButton,其中包含根据系统语言从 plist 文件中读取的英语或日语字符串。现在,当语言是英语时,我可以通过使用诸如 - 之类的代码来更改字体大小
[auxStatePopup setFont: [NSFont fontWithName:@"Helvetica-BoldOblique" size:10.0]];
,但是使用这种技术,即使我尝试设置一些我在谷歌上搜索并找到的日语字体名称,我也无法更改日语字体大小。
我想这样做是因为日语字符在使用时会稍微向上移动。我打算通过减小字体大小来操纵向上的运动。
感谢您的帮助..
或者
有什么方法可以向下移动 NSPopupButton 中的文本?
I have a NSPopUpButton which contains either English or Japanese Strings read from a plist file according to the System's Language. Now when the Language is English I am able to change the font size by using code such as -
[auxStatePopup setFont: [NSFont fontWithName:@"Helvetica-BoldOblique" size:10.0]];
but Using such technique I am not able to change Japanese font size even if I tried by setting some Japanese font name which I googled and found out.
I want to do that because Japanese characters move slightly up when used. I intend to manipulate that upward movement by decreasing font size.
Thanks for any help..
OR
any way to move text in NSPopupButton downwards?
发布评论
评论(1)
我的印象是这两个示例没有使用相同的字体。请尝试输入包含两组字符的文本,看看会发生什么。
另外,尽量不要自定义
字体大小
,甚至字体
。我还怀疑文本渲染引擎可能由于文本长度而覆盖了您的一些更改。如果文本不适合控件,iOS 文本渲染可能会尝试更改字母间距的字体大小。因此,用较短的文本进行一些测试。
顺便说一句,我认为你的意思是说你想要更大而不是更小的日语字体。在屏幕截图中,日语文本已经太小,任何人都无法正确阅读。
My impression is that the two samples are not using the same font. Please try to put a text with characters from both sets and see what happens.
Also try not to customize the
font size
and even thefont face
.I also suspect that the text rendering engine may had overridden some of your changes due to the text length. iOS text rendering may try to change the font size of letter spacing if the text does not fit the control. So make some tests with shorter texts.
BTW, I think that you were mean to say that you want bigger font size for Japanese not smaller. In the screenshots the Japanese text is already too small to be properly read by anyone.