Lines 853-859
Link Here
|
853 |
Element element) { |
853 |
Element element) { |
854 |
|
854 |
|
855 |
AttributedStringBuffer asb = new AttributedStringBuffer(); |
855 |
AttributedStringBuffer asb = new AttributedStringBuffer(); |
856 |
fillAttributedStringBuffer(ctx, element, true, null, null, null, asb); |
856 |
fillAttributedStringBuffer(ctx, element, true, null, null, null, null, asb); |
857 |
return asb.toAttributedString(); |
857 |
return asb.toAttributedString(); |
858 |
} |
858 |
} |
859 |
|
859 |
|
Lines 875-880
Link Here
|
875 |
TextPath textPath, |
875 |
TextPath textPath, |
876 |
Integer bidiLevel, |
876 |
Integer bidiLevel, |
877 |
Map initialAttributes, |
877 |
Map initialAttributes, |
|
|
878 |
Map parentAttributes, |
878 |
AttributedStringBuffer asb) { |
879 |
AttributedStringBuffer asb) { |
879 |
// 'requiredFeatures', 'requiredExtensions', 'systemLanguage' & |
880 |
// 'requiredFeatures', 'requiredExtensions', 'systemLanguage' & |
880 |
// 'display="none". |
881 |
// 'display="none". |
Lines 899-906
Link Here
|
899 |
Map map = initialAttributes == null |
900 |
Map map = initialAttributes == null |
900 |
? new HashMap() |
901 |
? new HashMap() |
901 |
: new HashMap(initialAttributes); |
902 |
: new HashMap(initialAttributes); |
|
|
903 |
Map elementAttributes = new HashMap(); |
902 |
initialAttributes = |
904 |
initialAttributes = |
903 |
getAttributeMap(ctx, element, textPath, bidiLevel, map); |
905 |
getAttributeMap(ctx, element, textPath, bidiLevel, elementAttributes); |
|
|
906 |
|
907 |
//Adjust the baseline-shift for the element based on the |
908 |
//value of the parent and build the parent attributes map |
909 |
//for the child of the element |
910 |
parentAttributes = handleNestedBaselineShift(parentAttributes, elementAttributes); |
911 |
|
912 |
map.putAll(elementAttributes); |
913 |
|
904 |
Object o = map.get(TextAttribute.BIDI_EMBEDDING); |
914 |
Object o = map.get(TextAttribute.BIDI_EMBEDDING); |
905 |
Integer subBidiLevel = bidiLevel; |
915 |
Integer subBidiLevel = bidiLevel; |
906 |
if (o != null) { |
916 |
if (o != null) { |
Lines 939-944
Link Here
|
939 |
textPath, |
949 |
textPath, |
940 |
subBidiLevel, |
950 |
subBidiLevel, |
941 |
initialAttributes, |
951 |
initialAttributes, |
|
|
952 |
parentAttributes, |
942 |
asb); |
953 |
asb); |
943 |
if (asb.count != before) { |
954 |
if (asb.count != before) { |
944 |
initialAttributes = null; |
955 |
initialAttributes = null; |
Lines 956-961
Link Here
|
956 |
newTextPath, |
967 |
newTextPath, |
957 |
subBidiLevel, |
968 |
subBidiLevel, |
958 |
initialAttributes, |
969 |
initialAttributes, |
|
|
970 |
parentAttributes, |
959 |
asb); |
971 |
asb); |
960 |
if (asb.count != before) { |
972 |
if (asb.count != before) { |
961 |
initialAttributes = null; |
973 |
initialAttributes = null; |
Lines 1003-1008
Link Here
|
1003 |
textPath, |
1015 |
textPath, |
1004 |
subBidiLevel, |
1016 |
subBidiLevel, |
1005 |
initialAttributes, |
1017 |
initialAttributes, |
|
|
1018 |
parentAttributes, |
1006 |
asb); |
1019 |
asb); |
1007 |
if (asb.count != before) { |
1020 |
if (asb.count != before) { |
1008 |
initialAttributes = null; |
1021 |
initialAttributes = null; |
Lines 1047-1052
Link Here
|
1047 |
tpi.endChar = elementEndChar; |
1060 |
tpi.endChar = elementEndChar; |
1048 |
} |
1061 |
} |
1049 |
|
1062 |
|
|
|
1063 |
/* |
1064 |
* Nested baseline-shift are additive, so keep track of all the |
1065 |
* baseline-shift value to calculate the final baseline shift |
1066 |
*/ |
1067 |
private Map handleNestedBaselineShift(Map parentAttributes, Map elementAttributes) |
1068 |
{ |
1069 |
if ( elementAttributes.containsKey(BASELINE_SHIFT) ) |
1070 |
{ |
1071 |
ArrayList list = new ArrayList(); |
1072 |
if ( parentAttributes != null && parentAttributes.containsKey(BASELINE_SHIFT) ) |
1073 |
{ |
1074 |
list.addAll((List)parentAttributes.get(BASELINE_SHIFT)); |
1075 |
} |
1076 |
list.add(elementAttributes.get(BASELINE_SHIFT)); |
1077 |
elementAttributes.put(BASELINE_SHIFT,list); |
1078 |
|
1079 |
Map newParentAttributes = new HashMap(); |
1080 |
newParentAttributes.put(BASELINE_SHIFT,list); |
1081 |
return newParentAttributes; |
1082 |
} |
1083 |
else if ( parentAttributes != null && parentAttributes.containsKey(BASELINE_SHIFT) ) |
1084 |
{ |
1085 |
elementAttributes.put(BASELINE_SHIFT,parentAttributes.get(BASELINE_SHIFT)); |
1086 |
} |
1087 |
return parentAttributes; |
1088 |
} |
1089 |
|
1050 |
/** |
1090 |
/** |
1051 |
* Normalizes the given string. |
1091 |
* Normalizes the given string. |
1052 |
*/ |
1092 |
*/ |