SVG textLength不起作用,还有其他任何解决方案吗?

时间:2015-11-14 23:34:14

标签: text svg fonts size inkscape

我在SVG中遇到一些问题,有人可以帮我吗?

我想在我已绘制的多边形中插入一个文本。文本的中心是完美的,但我无法控制文本的大小。

无论我为textLength做什么,文本都与inkscape保持一致。

    Resources resources;
    Bitmap bitmap = null;
    try {
        PackageManager manager = getPackageManager();
        resources = manager.getResourcesForApplication(packageName);

        Drawable image = resources.getDrawable(some_resource_int_id, null);
         bitmap = ((BitmapDrawable)image).getBitmap();
    }
    catch (PackageManager.NameNotFoundException e) {
    }

如何控制文字的长度(和高度)? text-font用于更改大小,但它没有显示精确的大小。 text-font =“55”的含义恰恰与文本的长度有关?我试过text-font =“55px”,但它没有改变任何东西:它大于55像素。

非常感谢

1 个答案:

答案 0 :(得分:0)

也许你正在寻找inkscape中的字母间距和行间距:

字母间距

Alt +>  expand line/paragraph by 1 
Shift + Alt +>  expand line/paragraph by 10 pixels
Alt +<  contract line/paragraph by 1 pixel
Shift + Alt +<  contract line/paragraph by 10 pixels
These commands (only when editing text) adjust letter spacing in the current line (regular text) or paragraph (flowed text).
The actual adjustment for pixel movements depends on zoom level. Zoom in for finer adjustment.

行间距

Ctrl + Alt +>   make the text object taller by 1 pixel
Shift + Ctrl + Alt +>   make the text object taller by 10 pixels
Ctrl + Alt +<   make the text object shorter by 1 pixel
Shift + Ctrl + Alt +<   make the text object shorter by 10 pixels
These commands (only when editing text) adjust line spacing in the entire text object (regular or flowed).
The actual adjustment for pixel movements depends on zoom level. Zoom in for finer adjustment.

来源:here