Preliminary ACIP->TMW support is in place. {DU} gives you something

less beautiful than what Jskad would give, so more work is needed.
This commit is contained in:
dchandler 2003-08-31 16:06:35 +00:00
parent 1f4d53be2e
commit 045c4069c9
12 changed files with 355 additions and 64 deletions

View file

@ -69,7 +69,8 @@ class ConvertDialog extends JDialog
ConvertDialog.this.theRealActionPerformed(e);
}};
private void updateWarningLevels() {
if (choices.getSelectedItem() == ACIP_TO_UNI)
if (choices.getSelectedItem() == ACIP_TO_UNI
|| choices.getSelectedItem() == ACIP_TO_TMW)
this.warningLevels.enable();
else
this.warningLevels.disable();
@ -418,7 +419,7 @@ class ConvertDialog extends JDialog
newFileNamePrefix = suggested_WYLIE_prefix;
} else if (TMW_TO_UNI == ct || ACIP_TO_UNI == ct) {
newFileNamePrefix = suggested_TO_UNI_prefix;
} else if (TM_TO_TMW == ct) {
} else if (TM_TO_TMW == ct || ACIP_TO_TMW == ct) {
newFileNamePrefix = suggested_TO_TMW_prefix;
} else {
ThdlDebug.verify(TMW_TO_TM == ct);

View file

@ -615,10 +615,8 @@ public class DuffPane extends TibetanPane implements FocusListener {
*/
public void setRomanAttributeSet(String font, int size) {
if (getTibDoc() != null) {
SimpleAttributeSet ras = new SimpleAttributeSet();
StyleConstants.setFontFamily(ras, romanFontFamily = font);
StyleConstants.setFontSize(ras, romanFontSize = size);
getTibDoc().setRomanAttributeSet(ras);
getTibDoc().setRomanAttributeSet(romanFontFamily = font,
romanFontSize = size);
}
}

View file

@ -27,6 +27,7 @@ import java.awt.*;
interface FontConverterConstants
{
final String ACIP_TO_UNI = "ACIP to Unicode";
final String ACIP_TO_TMW = "ACIP to TMW";
final String TM_TO_TMW = "TM to TMW";
final String TMW_TO_UNI = "TMW to Unicode";
final String TMW_TO_WYLIE = "TMW to Wylie";
@ -36,7 +37,9 @@ interface FontConverterConstants
final String FIND_ALL_NON_TMW = "Find all non-TMW";
final String FIND_ALL_NON_TM = "Find all non-TM";
final String[] CHOICES = new String[]{
final String[] CHOICES = new String[] {
ACIP_TO_UNI,
ACIP_TO_TMW,
TM_TO_TMW,
TMW_TO_UNI,
TMW_TO_WYLIE,

View file

@ -71,6 +71,7 @@ public class TibetanConverter implements FontConverterConstants {
boolean convertToUnicodeMode = false;
boolean convertToTMMode = false;
boolean convertACIPToUniMode = false;
boolean convertACIPToTMWMode = false;
boolean convertToTMWMode = false;
boolean convertToWylieMode = false;
boolean findSomeNonTMWMode = false;
@ -91,6 +92,8 @@ public class TibetanConverter implements FontConverterConstants {
= args[0].equals("--to-tibetan-machine-web"))
|| (convertACIPToUniMode
= args[0].equals("--acip-to-unicode"))
|| (convertACIPToTMWMode
= args[0].equals("--acip-to-tmw"))
|| (convertToUnicodeMode
= args[0].equals("--to-unicode"))
|| (convertToWylieMode
@ -180,6 +183,8 @@ public class TibetanConverter implements FontConverterConstants {
conversionTag = TM_TO_TMW;
} else if (convertACIPToUniMode) {
conversionTag = ACIP_TO_UNI;
} else if (convertACIPToTMWMode) {
conversionTag = ACIP_TO_TMW;
} else {
ThdlDebug.verify(convertToTMMode);
conversionTag = TMW_TO_TM;
@ -205,7 +210,7 @@ public class TibetanConverter implements FontConverterConstants {
honored. */
static int reallyConvert(InputStream in, PrintStream out, String ct,
String warningLevel) {
if (ACIP_TO_UNI == ct) {
if (ACIP_TO_UNI == ct || ACIP_TO_TMW == ct) {
try {
ArrayList al = ACIPTshegBarScanner.scanStream(in, null,
250 - 1 // DLC FIXME: make me configurable
@ -214,10 +219,17 @@ public class TibetanConverter implements FontConverterConstants {
return 47;
StringBuffer warnings = new StringBuffer();
boolean embeddedWarnings = (warningLevel != "None");
if (!ACIPConverter.convertToUnicode(al, out, null, warnings,
if (ACIP_TO_UNI == ct) {
if (!ACIPConverter.convertToUnicode(al, out, null, warnings,
embeddedWarnings,
warningLevel))
return 46;
} else {
if (!ACIPConverter.convertToTMW(al, out, null, warnings,
embeddedWarnings,
warningLevel))
return 46;
return 46;
}
if (embeddedWarnings && warnings.length() > 0)
return 45;
else