Java Code Examples for java.awt.font.TextLayout#getNextLeftHit()

The following examples show how to use java.awt.font.TextLayout#getNextLeftHit() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TextMeasureTests.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
public void runTest(Object ctx, int numReps) {
    TLExContext tlctx = (TLExContext)ctx;
    TextLayout tl = tlctx.tl;
    TextHitInfo[] hits = tlctx.hits;
    TextHitInfo hit;
    do {
        for (int i = 0; i < hits.length; ++i) {
            hit = tl.getNextLeftHit(hits[i]);
        }
    } while (--numReps >= 0);
}
 
Example 2
Source File: TextMeasureTests.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public void runTest(Object ctx, int numReps) {
    TLExContext tlctx = (TLExContext)ctx;
    TextLayout tl = tlctx.tl;
    TextHitInfo[] hits = tlctx.hits;
    TextHitInfo hit;
    do {
        for (int i = 0; i < hits.length; ++i) {
            hit = tl.getNextLeftHit(hits[i]);
        }
    } while (--numReps >= 0);
}
 
Example 3
Source File: TextMeasureTests.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public void runTest(Object ctx, int numReps) {
    TLExContext tlctx = (TLExContext)ctx;
    TextLayout tl = tlctx.tl;
    TextHitInfo[] hits = tlctx.hits;
    TextHitInfo hit;
    do {
        for (int i = 0; i < hits.length; ++i) {
            hit = tl.getNextLeftHit(hits[i]);
        }
    } while (--numReps >= 0);
}
 
Example 4
Source File: TextMeasureTests.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public void runTest(Object ctx, int numReps) {
    TLExContext tlctx = (TLExContext)ctx;
    TextLayout tl = tlctx.tl;
    TextHitInfo[] hits = tlctx.hits;
    TextHitInfo hit;
    do {
        for (int i = 0; i < hits.length; ++i) {
            hit = tl.getNextLeftHit(hits[i]);
        }
    } while (--numReps >= 0);
}
 
Example 5
Source File: TextMeasureTests.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public void runTest(Object ctx, int numReps) {
    TLExContext tlctx = (TLExContext)ctx;
    TextLayout tl = tlctx.tl;
    TextHitInfo[] hits = tlctx.hits;
    TextHitInfo hit;
    do {
        for (int i = 0; i < hits.length; ++i) {
            hit = tl.getNextLeftHit(hits[i]);
        }
    } while (--numReps >= 0);
}
 
Example 6
Source File: TextMeasureTests.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public void runTest(Object ctx, int numReps) {
    TLExContext tlctx = (TLExContext)ctx;
    TextLayout tl = tlctx.tl;
    TextHitInfo[] hits = tlctx.hits;
    TextHitInfo hit;
    do {
        for (int i = 0; i < hits.length; ++i) {
            hit = tl.getNextLeftHit(hits[i]);
        }
    } while (--numReps >= 0);
}
 
Example 7
Source File: HitTest.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public static void main(String args[]) {
   String s = new String(new int[]{0x1d400, 0x61}, 0, 2);
   Font font = new Font("Dialog", Font.PLAIN, 12);
   FontRenderContext frc = new FontRenderContext(null, false, false);
   TextLayout tl = new TextLayout(s, font, frc);
   TextHitInfo currHit = TextHitInfo.beforeOffset(3);
   TextHitInfo prevHit = tl.getNextLeftHit(currHit);
   System.out.println("index=" + prevHit.getCharIndex()+
                      " leading edge=" + prevHit.isLeadingEdge());
   if (prevHit.getCharIndex() != 2) {
       throw new RuntimeException("Expected 2 for hit index");
   }
}
 
Example 8
Source File: TextMeasureTests.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
public void runTest(Object ctx, int numReps) {
    TLExContext tlctx = (TLExContext)ctx;
    TextLayout tl = tlctx.tl;
    TextHitInfo[] hits = tlctx.hits;
    TextHitInfo hit;
    do {
        for (int i = 0; i < hits.length; ++i) {
            hit = tl.getNextLeftHit(hits[i]);
        }
    } while (--numReps >= 0);
}
 
Example 9
Source File: TextMeasureTests.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public void runTest(Object ctx, int numReps) {
    TLExContext tlctx = (TLExContext)ctx;
    TextLayout tl = tlctx.tl;
    TextHitInfo[] hits = tlctx.hits;
    TextHitInfo hit;
    do {
        for (int i = 0; i < hits.length; ++i) {
            hit = tl.getNextLeftHit(hits[i]);
        }
    } while (--numReps >= 0);
}
 
Example 10
Source File: TextMeasureTests.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public void runTest(Object ctx, int numReps) {
    TLExContext tlctx = (TLExContext)ctx;
    TextLayout tl = tlctx.tl;
    TextHitInfo[] hits = tlctx.hits;
    TextHitInfo hit;
    do {
        for (int i = 0; i < hits.length; ++i) {
            hit = tl.getNextLeftHit(hits[i]);
        }
    } while (--numReps >= 0);
}
 
Example 11
Source File: TextMeasureTests.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public void runTest(Object ctx, int numReps) {
    TLExContext tlctx = (TLExContext)ctx;
    TextLayout tl = tlctx.tl;
    TextHitInfo[] hits = tlctx.hits;
    TextHitInfo hit;
    do {
        for (int i = 0; i < hits.length; ++i) {
            hit = tl.getNextLeftHit(hits[i]);
        }
    } while (--numReps >= 0);
}
 
Example 12
Source File: TextMeasureTests.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
public void runTest(Object ctx, int numReps) {
    TLExContext tlctx = (TLExContext)ctx;
    TextLayout tl = tlctx.tl;
    TextHitInfo[] hits = tlctx.hits;
    TextHitInfo hit;
    do {
        for (int i = 0; i < hits.length; ++i) {
            hit = tl.getNextLeftHit(hits[i]);
        }
    } while (--numReps >= 0);
}
 
Example 13
Source File: TextMeasureTests.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
public void runTest(Object ctx, int numReps) {
    TLExContext tlctx = (TLExContext)ctx;
    TextLayout tl = tlctx.tl;
    TextHitInfo[] hits = tlctx.hits;
    TextHitInfo hit;
    do {
        for (int i = 0; i < hits.length; ++i) {
            hit = tl.getNextLeftHit(hits[i]);
        }
    } while (--numReps >= 0);
}
 
Example 14
Source File: TextMeasureTests.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
public void runTest(Object ctx, int numReps) {
    TLExContext tlctx = (TLExContext)ctx;
    TextLayout tl = tlctx.tl;
    TextHitInfo[] hits = tlctx.hits;
    TextHitInfo hit;
    do {
        for (int i = 0; i < hits.length; ++i) {
            hit = tl.getNextLeftHit(hits[i]);
        }
    } while (--numReps >= 0);
}