具有单一空间宽度的 WinRt TextBlock [英] WinRt TextBlock with single space width

查看:25
本文介绍了具有单一空间宽度的 WinRt TextBlock的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在路径元素上制作文本.为此,我将原始文本拆分为单个字符,并为每个字符创建新的 TextBlock 并在测量后计算其宽度.问题是,当 TextBlock 只包含一个空间时,它的宽度为 0,它的接缝空间正在被修剪.如何防止修剪空格?或者也许有更好的建议?非常感谢.

I'm trying to make a text on path element. To accomplish this I split original text to single characters and for each character create new TextBlock and count it's width after measurement. The problem is, that when a TextBlock contains only a single space it's width is 0, it seam's space is being trimmed. How do I prevent trimming spaces? Or maybe there's a better suggestion? Thanks a lot.

推荐答案

如果你想在路径上放置一个空格 - 你真的不需要在那里显示一个 TextBlock.如果您想衡量一个空间应该使用多少空间 [原文如此] - 您可以比较aa"和a a"之类的宽度.

If you want to place a space on path - you don't really need to display a TextBlock there. If you want to measure how much space a space should use [sic] - you can compare the width of something like "aa" and "a a".

这篇关于具有单一空间宽度的 WinRt TextBlock的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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