字体大小太大,不适合在高速缓存中 [英] Font size too large to fit in cache
问题描述
所以,我最近切换到Android 3.0(蜂巢)和我在使用硬件渲染一些问题,特别是在一定的自定义视图我写,我用200的字体大小来显示一些文本。
So i recently switched to android 3.0 (honeycomb) and i'm having some issues with hardware rendering, specifically at a certain custom view i've written where I use a font size of 200 to display some text.
不幸的是,似乎openGLRenderer不喜欢那种相当大的字体大小的非常多,给出的错误,我发现了日志中:
Unfortunately it seems the openGLRenderer doesn't like that kind of rather large font sizes very much, given the error i'm getting in the log:
06-06 16:22:00.080: ERROR/OpenGLRenderer(2503): Font size to large to fit in cache. width, height = 97, 145
有没有办法解决这个(或方法来解决它),这样我可以在想要的字体大小显示文本?
Are there ways around this (or ways to fix it) such that I can get the text displayed at the wanted font size?
推荐答案
只是一个想法:也许你可以使用<字体转换为轮廓href="http://developer.android.com/reference/android/graphics/Paint.html#getTextPath%28java.lang.String,%20int,%20int,%20float,%20float,%20android.graphics.Path%29">Paint.getTextPath(...)并使用此路径呈现文本。这应该允许您根据需要来调整路径。
Just an idea: Perhaps you can convert the font to an outline using Paint.getTextPath(...) and use this path to render the text. This should allow you to resize the path as needed.
这篇关于字体大小太大,不适合在高速缓存中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!