Commit graph

30 commits

Author SHA1 Message Date
a1tsal
948b4f575b Made HandleUserApostrophe work around Word/VBA font bug. Before
this workaround, when using TMW as TScript font, ]'<bsp>['g blew
  out; the second ' came out in the wrong (TMW) font.

  Changed type of variable "start" from Integer to Long in
  InsertTibetanTshegBarAsUnicode.  (Problem reported by Than Garson.)
  Also fixed the analogous problem in InsertForeignTshegBarAsTScript.

  SF bug [1151313]: AddInterlinealStylesIfNecessary failed to set the
  font names.  This bug could be duplicated by loading from Startup
  and doing ]s<alt-m>s; the phonetics came out in TScript.

  Add call to AddInterlinealStylesIfNecessary in
  ConvertToInterlinealText to fix problem when running from Startup
  (only).  Problem reported by Cathy Cantwell.

  oM was transcribed "ong" because I made M->ng for huM.  But that was
  totally bogus.  This change means that huM comes out hum, which is
  right for THDL (probably, although that is not well-defined) but
  wrong for Aro.  It's not possible to special-case huM for Aro
  without adding another flag, and since the implementation of Aro
  pronunciation is generally inaccurate, I'm going to punt for now.
2005-06-08 19:15:09 +00:00
a1tsal
a943bb342c Version 2.1b2:
Worked around newly-discovered Word bug that causes the selection
  change event handler to get called spuriously.  This caused bad
  behavior in alt+m.  Probably this bug has been around forever but
  either no one noticed it or it was masked by something else.

  Make HandleUserUCH call UpdateFromTransliteration, as needed.

  Add code in InsertInterlinealMatrix to force OScript input in the
  Wylie row.
2005-02-25 00:59:10 +00:00
a1tsal
9db7c5897d Change nr to be pronounced n, rather than nr. See SF bug 1150671. 2005-02-24 05:54:26 +00:00
a1tsal
cbc9de5bfb Fixed SF bug 793596: mangs came out mngas. Also fixed the case of mags.
Fixed 1118035 some more.  Yesterday I fixed it for Unicode; I had
  assumed this worked correctly for TMW, but it didn't, due to some
  buggy version 1.1 legacy code.  (So in fact this bug was in version
  2.0 as well, but no one complained.)
2005-02-24 01:42:41 +00:00
a1tsal
4bebad8082 Actually fix 1119028 (Enter and Tab when in TScript put you in OScript) 2005-02-23 07:59:17 +00:00
a1tsal
6d2b5f72df Fixed SF bug 1118035: newline and other whitespace got []ed in F10.
Fixed SF bug 1118391: Now starts in OScript mode, not TScript.

  Fixed SF bug 1119024: TCC->Unicode lost newlines and other whitespace.

  Fixed SF bug 1149395: allow s+n+r as Tibetan stack.

Working on fix for 1119028 by modifying SelectionIsTScript, which is probably
in an inconsistent state currently.
2005-02-23 05:41:26 +00:00
a1tsal
fddf3c4870 Fix bug in PrepareDistribution: It could set the font to TMU rather than TMW. 2005-02-04 02:58:59 +00:00
a1tsal
90e4234382 Add alt-key accelerators for Tibetan menu commands that don't have
dedicated keys.

  Comment out 0F0D canonicalization (mis)feature.
2005-02-04 02:52:21 +00:00
a1tsal
766cb24dc9 This is probably the final 2.1b1.
Implement the (apparent) Unicode // misfeature: Whenever two U+0F0D
  appear next to each other, by whatever means, they need to be
  combined into a single U+0F0E.

  Made MakeRangeTScript set .Font.NameBi, which seems to be necessary
  on alternate Tuesdays.

  Fix long-standing bug (was in 2.0, but I only just noticed it):
  single-quote should be open-curly after newline and tab, as well as
  after space.  Probably after some other things as well, like magic
  formatting codes, but it's too hard to figure out what.

  Fix bug introduced by the optimization of font changes: TCC->Unicode
  was failing to set the Unicode font, so everything came out Arial
  Uni.

  Fixed bug recently introduced in ProcessTibwn_iniLine that caused
  Tibetan stacks not to work.

  Fixed bug: when typing an OScript character, bombed if the
  selection was not collapsed.

  Fixed bug: _ was inserting 0020 rather than 00A0

  Fixed bug that looks like it goes back at least to 2.0, that
  inserting an alpha character in tscript after a symbol that has no
  wylie (other than \uXXXX) bombs because the symbol is wrong counted
  as CharOKinTshegBar.  If it does go back to 2.0 I'm somewhat
  surprised no one has noticed it; but probably these symbols are very
  rarely used.
2005-01-19 12:01:04 +00:00
a1tsal
4aa9128173 New feature for converting the 8-bit TCC fonts to Unicode.
Code-cleaned ReadTMWdefinitionFile which was an awful mess.  Did
  this along the way when implementing TCC 8-bit support.

  Unicode<->TMW conversion of whole document now applies to footnotes
  and endnotes.

  Now (per spec) use 00A0 space rather than 0020 (= ASCII 32) for EWTS _ .

  Implemented [] nesting rule for F9.  It already worked for F10,
  fortuitously.

  Optimize out most calls to MakeRange*Script (recently introduced to
  work around Word Unicode font-change bug); this improves performance
  and also decreases the number of useless font-change events on the
  Undo list.

  "combination" -> "deprecated" in Unicode definition reader.
2005-01-19 00:54:19 +00:00
a1tsal
8add415115 I had made an informal branch of this file called "Unicode hackup.dot"
for experimental Unicode extensions.  It's now clear that Unicode is
going in the trunk -- in fact I'm close to a first beta release -- so
I'm clobbering the "Unicode hackup.dot" file and checking in its
latest version here.

The changes:

Unicode support.  Extensive remodularization and code changes in most
parts of the system, far too much to detail here.  2.1 has roughly a
third more code than 2.0!

Per request of Cathy Cantwell, make F9 on body text that includes
footnotes/endnotes convert text of said notes.

In support of the previous, various changes to make Tibetan work in
footnotes (and endnotes) generally.

Pronunciation function now talks about "foreign" words rather than
"Sanskrit"; former is more generally correct.

Fixed prehistoric bug (goes back to Than's version 1.1) that I just
found: F6 went to end of document if you hit Cancel.

Fixed SourceForge bug 941183: literal curly quotes in VBA screwed up
Chinese Word.  (Need to get Jeff Wu to verify fix -- I couldn't
duplicate bug.)

Fixed SourceForge bug 986847: double quote doesn't curlify.  I
"fixed" this by removing the double-quote binding.  That's not the
optimal fix, but the only thing that's non-optimal about it is that
when you are typing EWTS, double-quote self-inserts rather than
telling you that it's not a valid EWTS character.

Fixed SourceForge bug 986850 (Interlineal failing when loaded from
Startup, due to an instance of the Word bug where Startup-loading
doesn't run initializations)

Fixed bug: in F9 conversion, \u allowed only lower-case (not
upper-case) alpha hex digits.

Fixed bug: in F9 conversion, \ was not interpreted as an escape
within [].

Fixed bug: \Z] did not return to TScript, but instead inserted the
].

Fixed bug: [ and ], when in Interlineal mode, now beep rather than
screwing things up.

Various uses of "English" replaced in the UI. (Trying to be less
ethnocentric; we have lots of users whose primary language is not
English.)
2005-01-16 00:43:46 +00:00
a1tsal
f6e5c6b045 Version 2.0p1:
Per request from Cathy Cantwell, add option to do F11 interlineal
  conversion without introducing tables, producing text only.  An
  unfortunate side-effect of this is that you get a one-time-only error
  message complaining about the options file (whose format has changed
  to store the value of this option).

  Changed the interlineal line breaking code to put only shad-like
  things at the end of lines, and not zla tse type things.  (But: it no
  longer breaks lines on zla tse type things at all; ideally it should
  break on those but put them at the beginning of lines.  On the other
  hand, you'd never expect to see a zla tse type thing other than after
  a shad type thing (or at the begnning of a text).)
2004-11-03 02:35:01 +00:00
a1tsal
79749d8909 Changed a bunch of Integer declarations to Long so that F11 conversion
wouldn't blow out on chunks of text longer than 32k characters (a
problem reported by Cathy Cantwell).  What a pathetic programming
language VBA is.
2004-11-02 07:15:14 +00:00
a1tsal
6f8ba71ad0 Fix problems reported by Julie Regan <juregan@hotmail.com> with
printing.  The page format and second-page-header were somehow
inherited from Matthew Kapstein's reader. This included line
numbering, non-standard margins, and the header.  Changed back to Word
defaults.
2004-11-01 09:31:14 +00:00
a1tsal
0d78ad1444 Total rewrite of ConvertWylie() to fix the problem, reported by Cathy
Cantwell (SF RFE #1034292), that it stripped footnotes (and other
non-text items).

Per request of Cathy Cantwell (SF bug 1034688), make
HandleUserApostrophe respect Options.AutoFormatAsYouTypeReplaceQuotes.
I.e., typing a ' will no longer get curly single quotes if you have
turned off the "smart quotes" autocorrect option (which lots of
Tibetanists may have done, so a-chung comes out decently).

Fix PartOfTshegBar to not accept [, which it did, due to an
inexplicable Obiwan error.  Clarify code to make Obiwan error less
likely.

Fix PartOfTshegBar to not accept H.  This is bogus; H is a Sanskrit
letter, but tibwn.ini claims it is punctuation, and our code depends
on that.
2004-11-01 07:57:02 +00:00
a1tsal
4596ec268b Fix bug reported by "Cathy Cantwell"
<catherine.cantwell@oriental-institute.oxford.ac.uk>
whereby TMW [m][kh]['][i] converted to EWTS makha'i.
2004-10-31 03:58:37 +00:00
a1tsal
779db45e92 Version 2.0: no code changes from 2.0b3; just incremented the About version number. 2004-07-07 20:04:32 +00:00
a1tsal
c80fa8879d Extensive, ugly code changes to make R+ work.
Sean Something <knowone@zensearch.com> pointed out that a special ha
  glyph (1,102) is supposed to be used solely in the case of hU.
  Added code to do so.
2004-04-21 19:17:02 +00:00
a1tsal
fd6d03d040 Change implementation of nasalization rule for lastest elaboration
thereof (n, not m, when root letter is b or ph but not pronounced as
  such).
2004-04-18 19:19:52 +00:00
a1tsal
97c1b4db57 Added support for recently-added nasalization rule in THDL phonetics.
Fixed bug: Sean Something <knowone@zensearch.com> and Christopher
  Walker <cewalker@uchicago.edu> correctly reported that lnga did not
  not stack when typed.  (It gave "lang".  But it worked correctly in
  F9 conversion.)  This was a side-effect of the "sara" fixes in
  2.0b2.  Fixed by invoking the consonant stack buffering code when we
  get "ln".

  Changed both parsers to allow ' (a-chung) as root, in order to handle
  "'od" which Robert Walker <robertjwalker@onetel.net.uk> correctly
  reported failed in Wylie->Tibetan conversion.  (It also failed in the
  opposite direction.)

  Fix typo in comment at beginning of Wylie parser.
2004-04-12 08:23:34 +00:00
a1tsal
11fc084f45 Version 2.0b2 (release candidate).
Fix the "sara" problem some more.  Fairly extensive code
modification and clean-up to get all cases correct.

Added support for vowel.vowel syntax (which was added to the EWTS
syntax after the first beta release).

Added new, more rigorous automated Wylie<->TMW testing procedure
(working on a by-character basis, simulating user typing rather than
just F9, F10 conversion).

Fixed bug in HandleUserUCS that made typing Sh fail after "a".

Fixed ugliness induced by recently-added code for doing interlineal
from Startup, whereby the top row had whitespace inherited from
Normal, which might be doublespaced or something; fix forces 3
pixels above and below, same as the other rows.

Made the phonetics code throw away ., ~, `, and ^.

Made the phonetics code turn M into "ng".
2004-02-27 10:08:46 +00:00
a1tsal
6e44a14ff8 Add TMW tsheg bar parser. Call it in FixTMW2WylieConversion. This
fixes various problems in TMW->Wylie Sanskrit conversion, viz.
  800153 (Typing sara gets sra), 811282 (F10 of ragyada is rgyad),
  and 811284 (F10 of gayarma gets ga.yarma).

  Removed the last of the (dangerous, bogus) globally-declared
  temporary variables.

  Fixed bug in R+ (the code I had written did the wrong thing in a
  complicated way; actually all that was needed was a single call to
  InsertLatinOrTibetanLetter, which already did the right thing in a
  simple way).
2004-02-24 14:59:30 +00:00
a1tsal
b705c780a7 Fixed SF bug 800193, which was due to Word's failure to inherit
styles from templates loaded from the Startup folder.  (They *are*
  inherited from templates loaded normally.)  Worked around the bug by
  having the code check whether the interlineal styles are defined,
  and if not, defining them programmatically.

  Added option to disable the EWTS interpretation of \ and ] when in
  non-Tibetan text.

  Added control-T as a way to get into Tibetan mode (for people who
  turn off ] and \).  This appears in the Tibetan menu as well.

  Implemented R+, +W, +Y, +R.

  Un-implemented tsa 'phru: it breaks the parser, and fixing it
  seems more trouble than it is worth.

  Remove a whole slew of styles that somehow virally infected the
  WylieWord template from David Germano's personal template.
2004-02-22 09:23:26 +00:00
a1tsal
77b3d4396b Change ^M to ~M and ^X to ~X to conform to spec change.
Introduce ~M` (for 0F82).
Make ^ be tsa phrul (per spec change).

Changed processing of <?Input:Numbers?> for recent change by DLC
whereby it contains lots of stuff other than numbers (ugh).
2004-02-20 15:16:16 +00:00
a1tsal
2e9ea92a3a Fixed phonetics code to strip post-suffix d (bug 800167 in
SourceForge).

  Implemented (somewhat kludgily) option for phonetics scheme to
  replace e with é iff it is the last letter of the last tsheg bar.
  This is required by the new THDL phonetics spec.

  New algorithm, per new THDL phonetics spec, for ba->wa processing.
  The heuristic is that it applies only to the last tsheg bar in
  multi-tsheg-bar words.  (Previously, ba always generated "?ba/wa?",
  which is maybe more correct but less attractive.)  This heuristic
  fails on, e.g., "tsheg bar".  Oh well.

  Rationalized format of phonetics file: > is used as separator in exceptions
  as well as rules.  (Previously, : was used in exceptions only.)
2004-02-20 09:37:23 +00:00
a1tsal
4b8013770f Version 2.0b1p5 (16 November 03, sent only to knowone@zensearch.com)
Fixed SourceForge bug #835911, reported by knowone@zensearch.com,
  viz. that if you did control-alt-O before anything else, it blew out.
  This actually only occurred when loading from the Startup folder, because
  doing that bypasses the initialization procedure (AAARGH -- yet another
  way in which loading from Startup differs from normal template loading).
  Fixed this by reorganizing several functions to get the initialization to
  happen anyway.

  knowone@zensearch.com reported that hrIM did not come out correctly: the
  default bindu was used rather than the gigu bindu.  This problem also
  occurred with hr-IM, although he did not report that.  The bug was that
  a-chung came after the gigu (or reverse gigu), so the bindu code saw A as
  the vowel.  Two changes were required to fix this.  One was to put the
  gigu after the a-chung (which is legal and equivalent) in InsertVowel.
  The other was that FixTMW2WylieConversion didn't know about -I at all.
  (This bug was left over from Than's code.)  I also corrected various
  confused code comments in FixTMW2WylieConversion, InsertPlainBindu, and
  InsertChandraBindu.

  Commented out code that suppressed screen updating in
  InsertTibetanLetter.  As reported by knowone@zensearch.com, this caused
  severe "screen flashing" because it forced Word to recompute the screen
  image from scratch (rather than incrementally).  However, removing it
  causes local flashing (of the current tsheg bar), which may be worse in
  some cases (notably long Sanskrit words).  Not sure what to do about
  this.  Ideally, WW could avoid having to delete and replace the whole
  tsheg bar, but would only update the character(s) that are changed as a
  result of the user's typing.  Unfortunately, this would be fairly
  difficult to do -- it would require a complete re-write of ConvertWylie,
  for starters.

  In Options dialog, select the TibFontSize widget text and give it focus.
  (Feature requested by knowone@zensearch.com on the grounds that this is the
  thing most likely to be changed.)

  Changed default for interlineal capitalization mode to "Never" (from "Unless
  first"). (This is more consistent with the rest of the program; requested by
  knowone@zensearch.com.)

  In InsertTibetanLetter, change the data type of 'position' from integer
  to long, to avoid overflow error on very long documents.

  Fixed bug in interlineal root-letter capitalization: its algorithm for
  "unless first" checked only for prefixes, not for superscripts, so it did
  not capitalize the k in "sku".  (Bug introduced in 2.0a7.)

  Changed some initializeWylieWord calls to reinitializeWylieWordIfNecessary,
  to avoid creating multiple copies of the event handler (which I thought
  was a likely cause of flashing/performance degradation reported by
  knowone@zensearch.com, but seems not to have been a significant factor).

  Changed the Options dialog OK procedure to not call the full initialization
  routine, but only LoadPhoneticsFile (which is all that was needed).  This was
  to avoid creating duplicate event handlers.

  Changed the functions that looked up Wylie in the font data tables to use
  hash tables rather than linear search of the arrays, on the theory that
  this might alleviate a performance bottleneck.  But it doesn't seem to
  have helped much.  In fact, testing shows that repeatedly simply
  inserting and deleting English text causes (approximately) quadratic
  performance degredation, probably due to maintaining Undo information.
  So some of the problem is inherent to Word (or VBA) and there is nothing
  I can do about it.

  Restored the Startup installation code (removed in p4) pending a ruling on this
  from David Germano.
2003-11-16 02:25:41 +00:00
a1tsal
d7ab5839a9 Version 2.0b1p4 (23 September 03, sent only to Werner Bruns and madkar@tiscali.it)
Commented out (but did not remove) the Startup installation feature (because,
  due to Word bugs, WW doesn't work right when loaded from Startup).

  Removed some code that was supposed to deal with the "sara->sra" bug
  (#800153 in SourceForge) but didn't.  The code was not actually called
  (because I knew it didn't work) but I had left it in on the theory that
  it might be fixable (but it probably isn't; a different approach is required).

  Added comment to code about ga.yarma problem.

  Updated the EWTS URL in the Tibetan menu for new thdl.org organization.

  On the Italian keyboard layout, there is simply no way to get a backquote,
  so VkKeyScan returns -1, which was causing four different pieces of code to
  blow up.  Fixed to check this case.  (For an unnamed friend of Werner Bruns.)

  Improve success message for phonetics testing.
2003-09-23 16:49:58 +00:00
a1tsal
38a78ad576 Work around two VBA bugs that caused WW not to work with the German
keyboard layout (as reported by Werner Bruns).
2003-09-16 20:41:30 +00:00
a1tsal
822fd4a675 2.0b1p2: Various attempts to work around Word "object not found"
problems seen by other people but not me.  Specifically:

  Added "Microsoft Scripting Runtime" to VBA References.  This might fix Werner
  Bruns's problem with "object not found" error during installation.

  Eliminated use of SendKeys in CapsLock translation, on the theory that it was
  responsible for DG's CapsLock problem.

  Changed all instances of Application. to Word.Application., which shouldn't
  be necessary according to the documentation, but seems to be more robust.

  Type-declared all Function return values (in attempt to avoid stupid run-time
  errors when loading from Startup folder; apparently code run from there is
  executed differently from that loaded from the templates folder, in a mode that
  is more sensitive to missing type declarations).
2003-09-15 00:21:04 +00:00
a1tsal
f6fc902973 Initial check-in of 2.0b1 binary files. 2003-09-04 03:14:24 +00:00