文本块中的文本消失,字体大小> 99 [英] Text in textblock vanishes with font size >99

查看:108
本文介绍了文本块中的文本消失,字体大小> 99的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发现,当WPF(4.0)的文本大小为100或更高时,至少一种ttf字体消失了.这是一个已知的错误吗?

例如
可以看到:

I have found that at least one ttf font vanishes in WPF (4.0) when its text size is 100 or higher. Is this a known bug?

E.g.
This can be seen:

<TextBlock x:Name="tb" FontFamily="Roboto" FontSize="99" Text="abcdef" HorizontalAlignment="Left" VerticalAlignment="Top" />


这不能:


This can''t:

<TextBlock x:Name="tb" FontFamily="Roboto" FontSize="100" Text="abcdef" HorizontalAlignment="Left" VerticalAlignment="Top" />



当通过渲染转换将文本放大时,这也适用:

可以看到:



This also applies when the text is enlarged through render transforms:

This can be seen:

<Grid Height="200">
  <TextBlock x:Name="tb" FontFamily="Roboto" FontSize="50" Text="abcdef" />
  <Grid.RenderTransform>
  <ScaleTransform ScaleX="1.9999" />
  </Grid.RenderTransform>
  </Grid>


但这不能:


But this can''t:

<Grid>
  <TextBlock x:Name="tb" FontFamily="Roboto" FontSize="50" Text="abcdef" />
  <Grid.RenderTransform>
  <ScaleTransform ScaleX="2" />
  </Grid.RenderTransform>
  </Grid>



文本块:
1)仍然排列整齐,并具有适当的实际高度和实际宽度值.
2)具有正常的不透明度和可见性值
3)如果有背景,则背景会显示正确/正确的尺寸等.

另外值得注意的是:
1)这种字体是由谷歌,似乎可以正常工作,否则.我什至在字体编辑器中将其打开,这似乎很正常
2)这是TTF字体
3)在所有大小的BUT字体下,MS Word等字体都可以正常工作
4)如果将具有此字体的Ms Word文件以大字体发布到XPS,则该字体在XPS文档中不可见(可选,但不可见.好像它的不透明度为0)
4)这也适用于内容控件和文本框

我之所以不只是选择其他字体",是因为我的程序使用了很多这样的字体.我无法手动检查每个!

有没有人见过这个?有什么想法吗?

可以从此处下载字体. roboto/"target =" _ blank"title =" New Window> ^ ]



The textblock:
1)Still arranges fine, and has appropriate actualheight and actualwidth values.
2)Has normal opacity and visibility values
3)If it has a background, the background appears fine/right size etc.

Also worth noting:
1)This font is by google and seems to work just fine otherwise. I''ve even opened it in a font editor and it seems normal
2)This is a TTF font
3)The font works fine in MS word etc at all font sizes BUT
4)If you publish an Ms Word file with this font at a large size to XPS, the font is invisible in the XPS doc (selectable, but not visible. As though it''s opacity is 0)
4)This applies to content controls and textboxes too

The reason I don''t just ''pick another font'' is because my program uses a LOT of fonts like this. I can''t manually check each one!

Has anyone seen this before? Any ideas?

The font can be downloaded from here[^]

推荐答案

我已经阅读了Microsoft的文档,但没有说关于FontSize限制的任何事情.将以下liks粘贴为参考:

http://msdn.microsoft.com/en-us/library/office/aa200988%28v = office.10%29.aspx [ http://msdn.microsoft.com/en-us/library/cc189010%28v = vs.95%29.aspx [ ^ ]

我对您的建议是前往Microsoft WPF论坛,并问这个问题是Microsoft员工的回答.我不认为这对程序员来说是一个普遍的问题,但是您永远不会知道:
http://social.msdn.microsoft.com/forums/en/wpf/threads/ [ ^ ]
I have read the documentation from Microsoft and it does not say anything about FontSize limit. Pasted the liks below as references:

http://msdn.microsoft.com/en-us/library/office/aa200988%28v=office.10%29.aspx[^]
http://msdn.microsoft.com/en-us/library/cc189010%28v=vs.95%29.aspx[^]

My advice to you is to head over to the Microsoft WPF Forum and ask this question were Microsoft employees ansers. I dont think this is a common problem for programmers, but you never know:
http://social.msdn.microsoft.com/forums/en/wpf/threads/[^]


我最终通过将textformattingmode指定为 display 来解决了这个问题.

I eventually solved this issue by specifying the textformattingmode to be display.

<textblock fontfamily="Roboto" fontsize="110" text="abcdef" textoptions.textformattingmode="Display" />


这篇关于文本块中的文本消失,字体大小> 99的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆