Skip to content
This repository has been archived by the owner on Jun 4, 2024. It is now read-only.

使對照表無需與字體集等長 #83

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 16 additions & 45 deletions src/main/java/cc/char_indexingtool/FontCorrespondTable.java
Original file line number Diff line number Diff line change
Expand Up @@ -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(宋體字體位址表, 注音字體對照表);
Expand Down Expand Up @@ -90,7 +84,7 @@ protected FontCorrespondTable(MergedFont 字體, ArrayList<HashMap<Integer, Inte
* 統一碼佮逐个字體內部編碼對照表。若無需要,彼格傳<code>null</code>
*/
public FontCorrespondTable(String[] 字體位置, ArrayList<HashMap<Integer, Integer>> 對照表集)
{

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

!!!1 不好了

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

super(字體位置);
this.對照表集 = 對照表集;
}
Expand All @@ -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;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

travis ci


10.10s$ gradle assemble
Picked up _JAVA_OPTIONS: -Xmx2048m -Xms512m
:compileJava/home/travis/build/sih4sing5hong5/han3_ji7_tsoo1_kian3/src/main/java/cc/char_indexingtool/FontCorrespondTable.java:126: error: ')' expected
				if (字體集[i].candisplay(取對照表字碼(i, 控制碼))
				                                     ^
1 error
 FAILED

}
}
return false;
Expand All @@ -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;
Expand Down