TextSymbol中未显示阿拉伯文字

时间:2018-10-10 07:10:33

标签: android fonts arcgis arabic-support arcgis-android-api

我需要在Android的TextSymbol中设置阿拉伯文字。这是我的代码

TextSymbol txtSymbol = new TextSymbol(24, "مرحبا", Color.BLUE);
Point pt = new Point(-293826, 7574114);
Graphic gr = new Graphic(pt, txtSymbol);
GraphicsLayer gl = new GraphicsLayer();
mMapView.addLayer(gl);
gl.addGraphic(gr);

注意:有方法setFontFamily(),我尝试使用某些字体,但不起作用。问题是从右向左的定向语言,例如阿拉伯语,希伯来语等。

1 个答案:

答案 0 :(得分:0)

请尝试通过这种方式将阿拉伯文本转换为UTF-8

   String input = "مرحبا";
   String arabicString= new String (input.getBytes("UTF8")); 

    TextSymbol txtSymbol = new TextSymbol(24, arabicString, Color.BLUE);
    Point pt = new Point(-293826, 7574114);
    Graphic gr = new Graphic(pt, txtSymbol);
    GraphicsLayer gl = new GraphicsLayer();
    mMapView.addLayer(gl);
    gl.addGraphic(gr);
相关问题