[B-Greek] Font converter

Ken Penner pennerkm at mcmaster.ca
Thu May 27 20:10:55 EDT 2004


I must disagree with Patrick here. Changing fonts and mappings is almost
trivially simple as a Word macro. The hardest part is the tedium of telling
the what the equivalents for the symbols are: e.g., C in BWGRKL is X in
SPIonic; you'd have to do this in PERL or Python, too.

Sub BW2SPIonic()
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find
        .Font.Name = "BWGRKL"
        .Replacement.Font.Name = "SPIONIC"
        .Forward = True
        .Wrap = wdFindContinue
        .Format = True
        .MatchCase = True
        .MatchWholeWord = False
        .MatchKashida = False
        .MatchDiacritics = False
        .MatchAlefHamza = False
        .MatchControl = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False

[here is where the mappings take place]

        .Text = "C": .Replacement.Text = "X": .Execute Replace:=wdReplaceAll
        .Text = "X": .Replacement.Text = "C": .Execute Replace:=wdReplaceAll

[insert all the other correspondences for accents, punctuation, etc., here.]

   End With
End Sub

> >   I wonder if someone might be able to give me osme
> > help, probably off-list.  I need to be able to convert
> > all the occurrences of Greek in a very large document
> > from Bibleworks Greek to SPIonic.  I could use some
> > hwelp in writing something that oucld find all the
> > occurrences of Greek and then convert them to SPIonic.
> > Thanks for yourh elp. While I program fora living,
> > word processing macros and font maniuplation aren't in
> > my background.

> As a programmer who has done a lot of converting of Greek texts, I 
> wouldn't try to do this in a word processor.  I'd dump it to an html 
> file and manipulate the file using python or perl.  Regular 
> expressions 
> make this kind of exercise trivially easy to complete.  You could 
> detect the Greek text in HTML by looking for whatever tag the word 
> process uses to change the font.  You could then reimport the 
> file into 
> a word processor, having changed the fonts and the encoded text.




More information about the B-Greek mailing list