Top Description Inners Fields Constructors Methods
org.apache.fontbox.ttf.gsub

public Class GsubWorkerForBengali

extends Object
implements GsubWorker
Class Inheritance
All Implemented Interfaces
org.apache.fontbox.ttf.gsub.GsubWorker
Imports
java.util.ArrayList, .Arrays, .Collections, .HashMap, .List, .Map, .Set, org.apache.commons.logging.Log, .LogFactory, org.apache.fontbox.ttf.CmapLookup, org.apache.fontbox.ttf.model.GsubData, .ScriptFeature

Bengali-specific implementation of GSUB system
Author
Palash Ray

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
GsubWorkerForBengali.BeforeAndAfterSpanComponent

Models characters like O-kar (ো) and OU-kar (ৌ).

Field Summary

Modifier and TypeField and Description
private static final GsubWorkerForBengali.BeforeAndAfterSpanComponent[]
private static final char[]
private final Map<Integer, GsubWorkerForBengali.BeforeAndAfterSpanComponent>
private final List<Integer>
private final CmapLookup
private static final List<String>
FEATURES_IN_ORDER

This sequence is very important.

private final GsubData
private static final String
private static final Log

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
private List<Integer>
applyGsubFeature(ScriptFeature scriptFeature, List<Integer> originalGlyphs)

public List<Integer>
applyTransforms(List<Integer>
list of original glyph IDs
originalGlyphIds
)

Implements org.apache.fontbox.ttf.gsub.GsubWorker.applyTransforms.

Applies language-specific transforms including GSUB and any other pre or post-processing necessary for displaying Glyphs correctly.

private Map<Integer, GsubWorkerForBengali.BeforeAndAfterSpanComponent>
private List<Integer>
private Integer
getGlyphId(char character)

private List<Integer>
private List<Integer>
private List<Integer>
repositionGlyphs(List<Integer> originalGlyphIds)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

BEFORE_AND_AFTER_SPAN_CHARSback to summary
private static final GsubWorkerForBengali.BeforeAndAfterSpanComponent[] BEFORE_AND_AFTER_SPAN_CHARS
BEFORE_HALF_CHARSback to summary
private static final char[] BEFORE_HALF_CHARS
beforeAndAfterSpanGlyphIdsback to summary
private final Map<Integer, GsubWorkerForBengali.BeforeAndAfterSpanComponent> beforeAndAfterSpanGlyphIds
beforeHalfGlyphIdsback to summary
private final List<Integer> beforeHalfGlyphIds
cmapLookupback to summary
private final CmapLookup cmapLookup
FEATURES_IN_ORDERback to summary
private static final List<String> FEATURES_IN_ORDER

This sequence is very important. This has been taken from https://docs.microsoft.com/en-us/typography/script-development/bengali

gsubDataback to summary
private final GsubData gsubData
INIT_FEATUREback to summary
private static final String INIT_FEATURE
LOGback to summary
private static final Log LOG

Constructor Detail

GsubWorkerForBengaliback to summary
pack-priv GsubWorkerForBengali(CmapLookup cmapLookup, GsubData gsubData)

Method Detail

applyGsubFeatureback to summary
private List<Integer> applyGsubFeature(ScriptFeature scriptFeature, List<Integer> originalGlyphs)
applyTransformsback to summary
public List<Integer> applyTransforms(List<Integer> originalGlyphIds)

Implements org.apache.fontbox.ttf.gsub.GsubWorker.applyTransforms.

Doc from org.apache.fontbox.ttf.gsub.GsubWorker.applyTransforms.

Applies language-specific transforms including GSUB and any other pre or post-processing necessary for displaying Glyphs correctly.

Parameters
originalGlyphIds:List<Integer>

list of original glyph IDs

Returns:List<Integer>

list of transformed glyph IDs

Annotations
@Override
getBeforeAndAfterSpanGlyphIdsback to summary
private Map<Integer, GsubWorkerForBengali.BeforeAndAfterSpanComponent> getBeforeAndAfterSpanGlyphIds()
getBeforeHalfGlyphIdsback to summary
private List<Integer> getBeforeHalfGlyphIds()
getGlyphIdback to summary
private Integer getGlyphId(char character)
repositionBeforeAndAfterSpanGlyphIdsback to summary
private List<Integer> repositionBeforeAndAfterSpanGlyphIds(List<Integer> originalGlyphIds)
repositionBeforeHalfGlyphIdsback to summary
private List<Integer> repositionBeforeHalfGlyphIds(List<Integer> originalGlyphIds)
repositionGlyphsback to summary
private List<Integer> repositionGlyphs(List<Integer> originalGlyphIds)
org.apache.fontbox.ttf.gsub back to summary

private Class GsubWorkerForBengali.BeforeAndAfterSpanComponent

extends Object
Class Inheritance
  • java.lang.Object
  • org.apache.fontbox.ttf.gsub.GsubWorkerForBengali.BeforeAndAfterSpanComponent

Models characters like O-kar (ো) and OU-kar (ৌ). Since these 2 characters is represented by 2 components, one before and one after the Vyanjan Varna on which this is used, this glyph has to be replaced by these 2 glyphs. For O-kar, it has to be replaced by E-kar (ে) and AA-kar (া). For OU-kar, it has be replaced by E-kar (ে) and ৗ.

Field Summary

Modifier and TypeField and Description
private final char
private final char
private final char

Constructor Summary

AccessConstructor and Description
pack-priv
BeforeAndAfterSpanComponent(char originalCharacter, char beforeComponentCharacter, char afterComponentCharacter)

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

afterComponentCharacterback to summary
private final char afterComponentCharacter
beforeComponentCharacterback to summary
private final char beforeComponentCharacter
originalCharacterback to summary
private final char originalCharacter

Constructor Detail

BeforeAndAfterSpanComponentback to summary
pack-priv BeforeAndAfterSpanComponent(char originalCharacter, char beforeComponentCharacter, char afterComponentCharacter)