Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deprecate JapaneseEnvironment leftover methods
Fix #8753
- Loading branch information
Showing
4 changed files
with
46 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
Extension { #name : #AbstractFont } | ||
|
||
{ #category : #'*Deprecated90' } | ||
AbstractFont >> scanMultibyteJapaneseCharactersFrom: startIndex to: stopIndex in: aWideString with: aCharacterScanner rightX: rightX [ | ||
"scan a multibyte Japanese character string" | ||
self deprecated: 'Deprecated similar to JapaneseEnvironment in Pharo 9'. | ||
^aCharacterScanner scanJapaneseCharactersFrom: startIndex to: stopIndex in: aWideString rightX: rightX | ||
|
||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
Extension { #name : #CharacterScanner } | ||
|
||
{ #category : #'*Deprecated90' } | ||
CharacterScanner >> isBreakableAt: index in: sourceString in: encodingClass [ | ||
"check with the encoding whether the character at index is a breakable character. | ||
Only the JISX0208 & JapaneseEnvironments ever return true, so only the scanJapaneseCharacters... method calls this" | ||
self deprecated: 'Deprecated similar to JapaneseEnvironment in Pharo 9'. | ||
^ encodingClass isBreakableAt: index in: sourceString. | ||
|
||
] | ||
|
||
{ #category : #'*Deprecated90' } | ||
CharacterScanner >> scanJapaneseCharactersFrom: startIndex to: stopIndex in: sourceString rightX: rightX [ | ||
"this is a scanning method for | ||
multibyte Japanese characters in a WideString - hence the isBreakable:in:in: | ||
a font that does not do character-pair kerning " | ||
|
||
| ascii encoding nextDestX char charset | | ||
self deprecated: 'Deprecated similar to JapaneseEnvironment in Pharo 9'. | ||
lastIndex := startIndex. | ||
lastIndex > stopIndex ifTrue: [^self handleEndOfRunAt: stopIndex]. | ||
charset := EncodedCharSet charsetAt: 0. | ||
[lastIndex <= stopIndex] whileTrue: [ | ||
char := sourceString at: lastIndex. | ||
ascii := char charCode. | ||
(encoding = 0 and: [ascii < 256 and:[(stopConditions at: ascii + 1) ~~ nil]]) | ||
ifTrue: [^ stopConditions at: ascii + 1]. | ||
(self isBreakableAt: lastIndex in: sourceString in: charset) | ||
ifTrue: [ self registerBreakableIndex]. | ||
nextDestX := destX + (font widthOf: char). | ||
nextDestX > rightX | ||
ifTrue: [^#crossedX]. | ||
destX := nextDestX + kern. | ||
lastIndex := lastIndex + 1. | ||
]. | ||
^self handleEndOfRunAt: stopIndex | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters