本文整理汇总了Java中com.ibm.icu.text.ArabicShaping类的典型用法代码示例。如果您正苦于以下问题:Java ArabicShaping类的具体用法?Java ArabicShaping怎么用?Java ArabicShaping使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ArabicShaping类属于com.ibm.icu.text包,在下文中一共展示了ArabicShaping类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: bidiReorder
import com.ibm.icu.text.ArabicShaping; //导入依赖的package包/类
@SuppressWarnings("unused")
public static String bidiReorder(IBFFontRenderer font, String text)
{
if (betterFontsEnabled && font.getStringRenderer() != null)
{
return text;
}
try
{
Bidi bidi = new Bidi((new ArabicShaping(8)).shape(text), 127);
bidi.setReorderingMode(0);
return bidi.writeReordered(2);
} catch (ArabicShapingException var3)
{
return text;
}
}
示例2: bidiReorder
import com.ibm.icu.text.ArabicShaping; //导入依赖的package包/类
/**
* Apply Unicode Bidirectional Algorithm to string and return a new possibly reordered string for visual rendering.
*/
private String bidiReorder(String p_147647_1_)
{
try
{
Bidi bidi = new Bidi((new ArabicShaping(8)).shape(p_147647_1_), 127);
bidi.setReorderingMode(0);
return bidi.writeReordered(2);
}
catch (ArabicShapingException var3)
{
return p_147647_1_;
}
}
示例3: bidiReorder
import com.ibm.icu.text.ArabicShaping; //导入依赖的package包/类
/**
* Apply Unicode Bidirectional Algorithm to string and return a new possibly reordered string for visual rendering.
*/
private String bidiReorder(String p_147647_1_)
{
try
{
Bidi var3 = new Bidi((new ArabicShaping(8)).shape(p_147647_1_), 127);
var3.setReorderingMode(0);
return var3.writeReordered(2);
}
catch (ArabicShapingException var31)
{
return p_147647_1_;
}
}
示例4: bidiReorder
import com.ibm.icu.text.ArabicShaping; //导入依赖的package包/类
/**
* Apply Unicode Bidirectional Algorithm to string and return a new possibly reordered string for visual rendering.
*/
private String bidiReorder(String text)
{
try
{
Bidi bidi = new Bidi((new ArabicShaping(8)).shape(text), 127);
bidi.setReorderingMode(0);
return bidi.writeReordered(2);
}
catch (ArabicShapingException var3)
{
return text;
}
}
示例5: bidiReorder
import com.ibm.icu.text.ArabicShaping; //导入依赖的package包/类
protected String bidiReorder(String p_147647_1_)
{
try
{
Bidi bidi = new Bidi((new ArabicShaping(8)).shape(p_147647_1_), 127);
bidi.setReorderingMode(0);
return bidi.writeReordered(2);
}
catch (ArabicShapingException arabicshapingexception)
{
return p_147647_1_;
}
}
示例6: func_147647_b
import com.ibm.icu.text.ArabicShaping; //导入依赖的package包/类
private String func_147647_b(String p_147647_1_)
{
try
{
Bidi var3 = new Bidi((new ArabicShaping(8)).shape(p_147647_1_), 127);
var3.setReorderingMode(0);
return var3.writeReordered(2);
}
catch (ArabicShapingException var31)
{
return p_147647_1_;
}
}
示例7: bidiReorder
import com.ibm.icu.text.ArabicShaping; //导入依赖的package包/类
private String bidiReorder(String p_147647_1_)
{
try
{
Bidi bidi = new Bidi((new ArabicShaping(8)).shape(p_147647_1_), 127);
bidi.setReorderingMode(0);
return bidi.writeReordered(2);
}
catch (ArabicShapingException arabicshapingexception)
{
return p_147647_1_;
}
}
示例8: initShapingSchemes
import com.ibm.icu.text.ArabicShaping; //导入依赖的package包/类
/**
* Populates Bidi shaping schemes list
*/
private void initShapingSchemes( )
{
shapingSchemes = new ArrayList<BidiScheme>( );
shapingSchemes.add( new BidiScheme( ".{3}S.", ".{3}NN", //$NON-NLS-1$ //$NON-NLS-2$
ArabicShaping.LETTERS_UNSHAPE | ArabicShaping.DIGITS_AN2EN ) );
shapingSchemes.add( new BidiScheme( ".{3}S.", ".{3}NH", //$NON-NLS-1$ //$NON-NLS-2$
ArabicShaping.LETTERS_UNSHAPE | ArabicShaping.DIGITS_EN2AN ) );
shapingSchemes.add( new BidiScheme( ".{3}S.", ".L.NC", //$NON-NLS-1$ //$NON-NLS-2$
ArabicShaping.LETTERS_UNSHAPE
| ArabicShaping.DIGITS_EN2AN_INIT_LR ) );
shapingSchemes.add( new BidiScheme( ".{3}S.", ".R.NC", //$NON-NLS-1$ //$NON-NLS-2$
ArabicShaping.LETTERS_UNSHAPE
| ArabicShaping.DIGITS_EN2AN_INIT_AL ) );
shapingSchemes.add( new BidiScheme( ".{3}N.", ".{3}SN", //$NON-NLS-1$ //$NON-NLS-2$
ArabicShaping.LETTERS_SHAPE | ArabicShaping.DIGITS_AN2EN ) );
shapingSchemes.add( new BidiScheme( ".{3}N.", ".{3}SH", //$NON-NLS-1$ //$NON-NLS-2$
ArabicShaping.LETTERS_SHAPE | ArabicShaping.DIGITS_EN2AN ) );
shapingSchemes.add( new BidiScheme( ".{3}N.", ".L.SC", //$NON-NLS-1$ //$NON-NLS-2$
ArabicShaping.LETTERS_SHAPE
| ArabicShaping.DIGITS_EN2AN_INIT_LR ) );
shapingSchemes.add( new BidiScheme( ".{3}N.", ".R.SC", //$NON-NLS-1$ //$NON-NLS-2$
ArabicShaping.LETTERS_SHAPE
| ArabicShaping.DIGITS_EN2AN_INIT_AL ) );
}
示例9: shape
import com.ibm.icu.text.ArabicShaping; //导入依赖的package包/类
/**
* Performs Arabic numeric and literal shaping
*
* @param str
* source String to shape
* @param options
* Shape options
* @return shaped String
*/
private String shape( String str, int options )
{
ArabicShaping shaper = new ArabicShaping( options
| ArabicShaping.TEXT_DIRECTION_VISUAL_LTR );
try
{
return shaper.shape( str );
}
catch ( ArabicShapingException e )
{
e.printStackTrace( );
return str;
}
}
示例10: transform
import com.ibm.icu.text.ArabicShaping; //导入依赖的package包/类
public void transform( ITextContent textContent )
{
String transformType = textContent.getComputedStyle( )
.getTextTransform( );
if ( transformType.equalsIgnoreCase( "uppercase" ) ) //$NON-NLS-1$
{
textContent.setText( textContent.getText( ).toUpperCase( ) );
}
else if ( transformType.equalsIgnoreCase( "lowercase" ) ) //$NON-NLS-1$
{
textContent.setText( textContent.getText( ).toLowerCase( ) );
}
else if ( transformType.equalsIgnoreCase( "capitalize" ) ) //$NON-NLS-1$
{
textContent.setText( capitalize( textContent.getText( ) ) );
}
ArabicShaping shaping = new ArabicShaping(ArabicShaping.LETTERS_SHAPE);
try
{
String shapingText = shaping.shape( textContent.getText( ));
textContent.setText(shapingText);
}
catch ( ArabicShapingException e )
{
logger.log( Level.WARNING, e.getMessage( ), e );
}
}