This repository has been archived by the owner on Jun 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 18
使對照表無需與字體集等長 #83
Open
Artoria2e5
wants to merge
2
commits into
master
Choose a base branch
from
a2e5-FontCorrespondTable-len
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
使對照表無需與字體集等長 #83
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
---|---|---|
|
@@ -49,12 +49,6 @@ public class FontCorrespondTable extends MergedFont | |
ArrayList<HashMap<Integer, Integer>> 注音字體對照表 = new ArrayList<HashMap<Integer, Integer>>(); | ||
注音字體對照表.add(吳守禮注音字體對照表); | ||
注音字體對照表.add(入聲注音字體對照表); | ||
注音字體對照表.add(null); | ||
注音字體對照表.add(null); | ||
注音字體對照表.add(null); | ||
注音字體對照表.add(null); | ||
注音字體對照表.add(null); | ||
注音字體對照表.add(null); | ||
|
||
吳守禮注音摻楷體字體 = new FontCorrespondTable(楷體字體位址表, 注音字體對照表); | ||
吳守禮注音摻宋體字體 = new FontCorrespondTable(宋體字體位址表, 注音字體對照表); | ||
|
@@ -90,7 +84,7 @@ protected FontCorrespondTable(MergedFont 字體, ArrayList<HashMap<Integer, Inte | |
* 統一碼佮逐个字體內部編碼對照表。若無需要,彼格傳<code>null</code> | ||
*/ | ||
public FontCorrespondTable(String[] 字體位置, ArrayList<HashMap<Integer, Integer>> 對照表集) | ||
{ | ||
|
||
super(字體位置); | ||
this.對照表集 = 對照表集; | ||
} | ||
|
@@ -113,31 +107,24 @@ public FontCorrespondTable(String[] 字體位置, ArrayList<HashMap<Integer, Int | |
return new FontCorrespondTable(super.調整字體參數(字體選項, 字型大小), 對照表集); | ||
} | ||
|
||
private int 取對照表字碼(int 對照表號, int 控制碼) { | ||
if (對照表號 < 對照表集.length) | ||
if (對照表集.get(對照表號) != null) | ||
if (對照表集.get(對照表號).containsKey(控制碼)) | ||
return 對照表集.get(對照表號).get(控制碼); | ||
|
||
return 控制碼; | ||
} | ||
|
||
@Override | ||
public boolean 有這个字型無(int 控制碼, int 字體編號) | ||
{ | ||
if (字體編號 == 0) | ||
{ | ||
for (int i = 0; i < 字體集.length; ++i) | ||
{ | ||
if (對照表集.get(i) != null) | ||
{ | ||
if (對照表集.get(i).containsKey(控制碼)) | ||
{ | ||
if (字體集[i].canDisplay(對照表集.get(i).get(控制碼))) | ||
{ | ||
return true; | ||
} | ||
} | ||
} | ||
else | ||
{ | ||
if (字體集[i].canDisplay(控制碼)) | ||
{ | ||
return true; | ||
} | ||
|
||
} | ||
if (字體集[i].candisplay(取對照表字碼(i, 控制碼)) | ||
return true; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
} | ||
} | ||
return false; | ||
|
@@ -150,26 +137,10 @@ public FontCorrespondTable(String[] 字體位置, ArrayList<HashMap<Integer, Int | |
{ | ||
for (int i = 0; i < 字體集.length; ++i) | ||
{ | ||
if (對照表集.get(i) != null) | ||
{ | ||
if (對照表集.get(i).containsKey(控制碼)) | ||
{ | ||
if (字體集[i].canDisplay(對照表集.get(i).get(控制碼))) | ||
{ | ||
return 字體集[i].createGlyphVector(渲染選項, | ||
Character.toChars(對照表集.get(i).get(控制碼))); | ||
} | ||
} | ||
} | ||
else | ||
{ | ||
if (字體集[i].canDisplay(控制碼)) | ||
{ | ||
return 字體集[i].createGlyphVector(渲染選項, | ||
Character.toChars(控制碼)); | ||
} | ||
|
||
} | ||
int 臨時字碼 = 字體集[i].candisplay(取對照表字碼(i, 控制碼)); | ||
if (字體集[i].canDisplay(臨時字碼)) | ||
return 字體集[i].createGlyphVector(渲染選項, | ||
Character.toChars(臨時字碼)); | ||
} | ||
} | ||
return null; | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
!!!1 不好了
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?