Esempio n. 1
0
  protected void computeInitialGlyphLayout(@NtN Vector2 size) {
    glyphLayout.setText(font, rawText, Color.BLACK, size.x, Align.left, true);
    StringBuilder text = new StringBuilder();
    float minY = 0, maxY = 0;
    for (GlyphLayout.GlyphRun run : glyphLayout.runs) {
      minY = Math.min(run.y, minY);
      maxY = Math.max(run.y, maxY);
      for (BitmapFont.Glyph glyph : run.glyphs) text.append(glyph.toString());
    }

    computedText = text.toString();
    futureRuns = new Array<>(glyphLayout.runs);
    futureRuns.reverse();
    glyphLayout.runs.clear();
  }
Esempio n. 2
0
 @Override
 public String getResultAsString() {
   BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));
   try {
     int approxStringLength = connection.getContentLength();
     StringBuilder b;
     if (approxStringLength > 0) b = new StringBuilder(approxStringLength);
     else b = new StringBuilder();
     String line;
     while ((line = reader.readLine()) != null) b.append(line);
     return b.toString();
   } catch (IOException e) {
     return "";
   } finally {
     StreamUtils.closeQuietly(reader);
   }
 }