Package org.pentaho.reporting.libraries.fonts.encoding

Examples of org.pentaho.reporting.libraries.fonts.encoding.CodePointStream


      return "";
    }

    codePointBuffer.setCursor(0);

    final CodePointStream cps = new CodePointStream(codePointBuffer, length);
    final int maxPos = offset + length;
    for (int i = offset; i < maxPos; i++)
    {
      final int glyphIndex = glyphIndices[i];
      final int glyphDataStart = glyphIndex + GlyphList.EXTRA_GLYPH_INFO;
      final int glyphDataEnd = glyphDataStart + glyphSequenceData[glyphIndex] + 1;
      for (int g = glyphDataStart; g < glyphDataEnd; g++)
      {
        cps.put(glyphSequenceData[g]);
      }
    }
    cps.close();
    return Utf16LE.getInstance().encodeString(codePointBuffer);
  }
View Full Code Here


  public String getGlyphAsString(final int index, final CodePointBuffer codePointBuffer)
  {
    codePointBuffer.setCursor(0);

    final CodePointStream cps = new CodePointStream(codePointBuffer, 5);
    final int glyphIndex = glyphIndices[index];
    final int glyphDataStart = glyphIndex + GlyphList.EXTRA_GLYPH_INFO;
    final int glyphDataEnd = glyphDataStart + glyphSequenceData[glyphIndex] + 1;
    for (int g = glyphDataStart; g < glyphDataEnd; g++)
    {
      cps.put(glyphSequenceData[g]);
    }
    cps.close();
    return Utf16LE.getInstance().encodeString(codePointBuffer);
  }
View Full Code Here

  }

  public void testWrite ()
  {
    final CodePointBuffer buffer = new CodePointBuffer(0);
    final CodePointStream cps = new CodePointStream(buffer, 10);
    cps.put(10);
    cps.put(11);
    cps.put(12);
    cps.put(13);

    cps.put(new int[]{20, 21, 22, 23, 24, 25});
    cps.close();

    assertEquals("Buffer-Cursor: ", 10, buffer.getCursor());
  }
View Full Code Here

    else if ((buffer.getLength()) < length)
    {
      buffer.ensureSize(length);
    }

    final CodePointStream cps = new CodePointStream(buffer, 10);
    final int maxPos = offset + length;
    for (int i = offset; i < maxPos; i++)
    {
      final char c = chars[i];
      if ((c & 0xFC00) == 0xD800)
      {
        i += 1;
        if (i < maxPos)
        {
          final char c2 = chars[i];
          if ((c2 & 0xFC00) == 0xDC00)
          {
            final int codePoint = 0x10000 +
                    ((c2 & 0x3FF) | ((c & 0x3FF) << 10));
            cps.put(codePoint);
          }
          else
          {
            // Should not happen ..
          }
        }
        else
        {
          // illegal char .. ignore it ..
          // of course: This should not happen, as this produced by JDK code
          break;
        }
      }
      else
      {
        cps.put(c);
      }
    }
    cps.close();
    return buffer;
  }
View Full Code Here

    else if ((buffer.getLength()) < length)
    {
      buffer.ensureSize(length);
    }

    final CodePointStream cps = new CodePointStream(buffer, 10);
    final int maxPos = offset + length;
    for (int i = offset; i < maxPos; i++)
    {
      final char c = chars[i];
      if ((c & 0xFC00) == 0xD800)
      {
        i += 1;
        if (i < maxPos)
        {
          final char c2 = chars[i];
          if ((c2 & 0xFC00) == 0xDC00)
          {
            final int codePoint = 0x10000 +
                    ((c2 & 0x3FF) | ((c & 0x3FF) << 10));
            cps.put(codePoint);
          }
          else
          {
            // Should not happen ..
          }
        }
        else
        {
          // illegal char .. ignore it ..
          // of course: This should not happen, as this produced by JDK code
          break;
        }
      }
      else
      {
        cps.put(c);
      }
    }
    cps.close();
    return buffer;
  }
View Full Code Here

  }

  public void testWrite ()
  {
    final CodePointBuffer buffer = new CodePointBuffer(0);
    final CodePointStream cps = new CodePointStream(buffer, 10);
    cps.put(10);
    cps.put(11);
    cps.put(12);
    cps.put(13);

    cps.put(new int[]{20, 21, 22, 23, 24, 25});
    cps.close();

    assertEquals("Buffer-Cursor: ", 10, buffer.getCursor());
  }
View Full Code Here

TOP

Related Classes of org.pentaho.reporting.libraries.fonts.encoding.CodePointStream

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.