Package org.jfree.fonts.encoding

Examples of org.jfree.fonts.encoding.CodePointStream


    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

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

    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 ()
  {
    CodePointBuffer buffer = new CodePointBuffer(0);
    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.jfree.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.