PDA

View Full Version : Converting BW-Greek in documents to the new SBL Greek font - how?



MortenJensen
03-20-2009, 07:57 AM
Hi all

I am in the situation that an article ready for publication needs to have its BW-Greek-font-citations substituted with the SBL Greek font (the new one).

Could a merciful soul explain to me how this is done the easiest way?
I know some earlier macros have been prepared to do some of this - but since I am not familiar with macro language, I am afraid I will not be able to alter them by my self.

Has someone done this already?

Thanks for any help!

Morten

almather
03-20-2009, 09:36 AM
If you have installed the SBL font, You can compose your paper than in your word program convert the Greek to SBL by changing the font there.

Or, if you have a lot and haven't put the Greek into your word program yet. Click on the little "wrench" on your tool bar, go to "font", and then "export font", and change the Greek text to SBL Greek by scrolling down the list of available fonts.

Hope this helps.

Al

MortenJensen
03-21-2009, 06:11 AM
Hej Al

Unfortunately, I don't think any of your suggestions work in my case which is:

1: I have already written my article and all the Greek is formated using the good old BW-font (non unicode).

2: Now I would like to have it substituted to the new SBL Greek font, which is unicode. Therefore I can not do a simple search-replace action.

I will need a complicated macro for this.

Would anyone have worked out such a macro for this font specifically?

Thanks again!
Morten

J Kendall
03-21-2009, 08:12 AM
Morten,

My macro will do what you require. It's posted at:

http://www.bibleworks.com/forums/showpost.php?p=2174&postcount=12

As posted, it will convert all bwgrkl.ttf text to Palatino Linotype. However, it's easy to modify the macro to whatever Unicode font you wish to use. Just edit it as a text file, searching and replacing the font name.

Alternatively, if you're not comfortable in doing this, just run the macro as it stands. Once you've applied the conversion to Unicode, you can search and replace the Palatino Linotype text with whatever Unicode font you require. This should work nicely, as all Unicode fonts use the same underlying coding for each Greek character.

There is however one complication. The macro will not convert bwgrkl.ttf text in footnotes. I've never been able to work out how to do this, so you will need to extract the footnotes into another file, convert them and then replace them.

Hope this works for you.

John
--
John Kendall
Cardiff
Wales

MortenJensen
03-22-2009, 09:30 AM
Hi John!

Thanks, yes it works great! I did a simple search and replace and were able to replace all the Greek in the text.

Ufortunately, as you said, it will not do its magic in the footnotes.

So, I would really also be grateful if anyone knows how to tweak Word to make this happen as well.

Anyone?

Morten

NB: I have attached the text of the altered macro if anyone wants to use the new SBL font as well.
I don't know how you the easiest way set a macro in Word. What I did, though, was to create an 'emty' macro at first, and the cut'n paste the text from the attached file (excluding the first and last line) into Visual Basic (open Normal + New Macroes within it).

Is there a better way to do it?

MortenJensen
03-22-2009, 09:32 AM
Here we go again ...

J Kendall
03-22-2009, 01:54 PM
Hi Morten,



Ufortunately, as you said, it will not do its magic in the footnotes.

So, I would really also be grateful if anyone knows how to tweak Word to make this happen as well.

Anyone?


I did a little searching in the help files and with a little guesswork came up with this. I've only done some basic testing, but it seems to work. You'll need to edit the font as with the other macro. The macro isn't fast, so be patient.

All the best,

John
--
John Kendall
Cardiff
Wales

MortenJensen
03-23-2009, 05:45 AM
Great work, John!
Maybe it is not fast fast, but it works like a charm! I have attached the tweaked version for SBL Greek. All you have to do now is to run both macros, the one for the text, the other one for the footnotes (besides also downloading the new beautiful 'standard' Greek font from SBL: http://www.sbl-site.org/educational/BiblicalFonts_SBLGreek.aspx).

Well, I hope this more or less settles and old problem of converting. Up until now many publishers would ask for SBLs old font, SPIonic. However, there is to my mind no way of converting bwgrkl to SPIonic.
This pain should be all history now ... :)

Morten

jdarlack
03-23-2009, 10:21 AM
Very good work, gentleman! Do you mind if I upload these macros to the BibleWorks blog?

J Kendall
03-23-2009, 11:42 AM
You're welcome, Jim.

John
--
John Kendall
Cardiff
Wales

Glenn Weaver
03-23-2009, 12:17 PM
There is a font conversion BW font to Unicode font contained in the BW8 Help file, chapter 59. The macros are also included in unimacros.txt in the main BibleWorks program directory. You will have to copy the text of macros, then open the Word Macro editor and paste the macros into the Word Macro editor. Then run the macros.

We haven't had a lot of feedback on them, so make sure that you make a backup copy of your document before you run the macros. You can change the font names in the macro to convert directly to SBL Greek and SBL Hebrew, if you wish.

doc_dave
06-13-2009, 02:03 PM
There is a font conversion BW font to Unicode font contained in the BW8 Help file, chapter 59. The macros are also included in unimacros.txt in the main BibleWorks program directory.

Would it be possible for these macros to be made available apart from BW8? I have BW7, and a fair heap of Word files that I would love to be able to run a Bwhebb > Unicode macro on. Or is it already out there somewhere and I've missed it?

And if it isn't "out there" yet ... pretty please? ;)

Greg Ward
06-13-2009, 10:13 PM
BW8 Help chapter 59 is very similar to BW7 Help chapter 46. I think you'll find what you need there.

doc_dave
06-14-2009, 12:50 PM
BW8 Help chapter 59 is very similar to BW7 Help chapter 46. I think you'll find what you need there.

I have indeed! Many thanks for this, Greg -- you've made me feel a little bit like Cyrus (cf. Isa 45:3)!

Update: I just tried this out, and for the record, the macros (well, ConvertAllBwHeb2Unicode anyway! the one I'm most interested in) worked beautifully, from the BW7 help file, using Word 2002 (!). So that's good news, then. :)

andyn
10-06-2009, 12:19 PM
Sorry to revive an old thread but...I am trying to convert bwhebb font to SBL Hebrew using the unimacros.txt. I replaced Ezra SIL with SBL Hebrew. However it isn't playing nice with Word 2007 and the Hebrew font is garbled. Can anyone help modify the macro. The macro text is below
As an aside, it works perfectly with Greek - only struggling with Hebrew.
Thanks.

Sub ConvertBwHeb2Unicode(fromfont$, tofont$, doentirefile)
Dim o As Object
Dim ucstr As Variant
ReDim ucstr(1024) As Long
If (doentirefile = True) Then Selection.HomeKey Unit:=wdStory
Set o = CreateObject("bwcom.document")
Application.ScreenUpdating = True
icheck = 0
While (icheck = 0)
Selection.Find.ClearFormatting
With Selection.Find
.Font.Name = fromfont$
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchKashida = False
.MatchDiacritics = False
.MatchAlefHamza = False
.MatchControl = False
.MatchByte = False
.CorrectHangulEndings = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = False
.MatchFuzzy = False
End With
If (Selection.Find.Execute = False) Then
icheck = 1
Else
istart = 1
iend = Selection.Characters.Count
ReDim ucstr(3 * iend + 2) As Long
ucstr(1) = iend
For i = istart To iend
ucstr(i + 1) = Asc(Selection.Characters(i))
Next i
o.BwHebb2Unicode ucstr
Selection.Delete
Application.Keyboard (1037)
With Selection.Font
.NameFarEast = "SimSun"
.NameAscii = "Arial"
.NameOther = "Arial"
.Name = "Arial"
.Size = 10
.Bold = False
.Italic = False
.Underline = wdUnderlineNone
.UnderlineColor = wdColorAutomatic
.StrikeThrough = False
.DoubleStrikeThrough = False
.Outline = False
.Emboss = False
.Shadow = False
.Hidden = False
.SmallCaps = False
.AllCaps = False
.Color = wdColorAutomatic
.Engrave = False
.Superscript = False
.Subscript = False
.Spacing = 0
.Scaling = 100
.Position = 0
.Kerning = 0
.Animation = wdAnimationNone
.DisableCharacterSpaceGrid = False
.EmphasisMark = wdEmphasisMarkNone
.SizeBi = 14
.NameBi = tofont$
.BoldBi = False
.ItalicBi = False
End With
For i = 1 To ucstr(1)
s$ = ChrW(ucstr(i + 1))
Selection.TypeText Text:=s$
Next i
Application.Keyboard (1033)
End If
If (doentirefile = False) Then icheck = 1
Wend

Application.ScreenUpdating = True
Set bwutil = Nothing

End Sub

Sub ConvertBwGrk2Unicode(fromfont$, tofont$, doentirefile)
Dim o As Object
Dim ucstr As Variant
ReDim ucstr(1024) As Long
If (doentirefile = True) Then Selection.HomeKey Unit:=wdStory
Set o = CreateObject("bwcom.document")
icheck = 0
While (icheck = 0)
Selection.Find.ClearFormatting
With Selection.Find
.Font.Name = fromfont$
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchKashida = False
.MatchDiacritics = False
.MatchAlefHamza = False
.MatchControl = False
.MatchByte = False
.CorrectHangulEndings = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = False
.MatchFuzzy = False
End With
If (Selection.Find.Execute = False) Then
icheck = 1
Else
istart = 1
iend = Selection.Characters.Count
ReDim ucstr(3 * iend + 2) As Long
ucstr(1) = iend
For i = istart To iend
ucstr(i + 1) = Asc(Selection.Characters(i))
Next i
o.BwGrkl2Unicode ucstr
Selection.Delete
Application.Keyboard (1032)
With Selection.Font
.NameFarEast = "SimSun"
.NameAscii = "Arial"
.NameOther = "Arial"
.Name = "Arial"
.Size = 10
.Bold = False
.Italic = False
.Underline = wdUnderlineNone
.UnderlineColor = wdColorAutomatic
.StrikeThrough = False
.DoubleStrikeThrough = False
.Outline = False
.Emboss = False
.Shadow = False
.Hidden = False
.SmallCaps = False
.AllCaps = False
.Color = wdColorAutomatic
.Engrave = False
.Superscript = False
.Subscript = False
.Spacing = 0
.Scaling = 100
.Position = 0
.Kerning = 0
.Animation = wdAnimationNone
.DisableCharacterSpaceGrid = False
.EmphasisMark = wdEmphasisMarkNone
.SizeBi = 14
.NameBi = tofont$
.BoldBi = False
.ItalicBi = False
End With
For i = 1 To ucstr(1)
s$ = ChrW(ucstr(i + 1))
Selection.TypeText Text:=s$
Next i
Application.Keyboard (1033)
End If
If (doentirefile = False) Then icheck = 1
Wend
Set bwutil = Nothing
End Sub

Sub ConvertBwSym2Unicode(fromfont$, tofont$, doentirefile)
Dim o As Object
Dim ucstr As Variant
ReDim ucstr(1024) As Long
If (doentirefile = True) Then Selection.HomeKey Unit:=wdStory
Set o = CreateObject("bwcom.document")
icheck = 0
While (icheck = 0)
Selection.Find.ClearFormatting
With Selection.Find
.Font.Name = fromfont$
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchKashida = False
.MatchDiacritics = False
.MatchAlefHamza = False
.MatchControl = False
.MatchByte = False
.CorrectHangulEndings = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = False
.MatchFuzzy = False
End With
If (Selection.Find.Execute = False) Then
icheck = 1
Else
istart = 1
iend = Selection.Characters.Count
ReDim ucstr(3 * iend + 2) As Long
ucstr(1) = iend
For i = istart To iend
ucstr(i + 1) = Asc(Selection.Characters(i))
Next i
o.BwSym2Unicode ucstr
Selection.Delete
Application.Keyboard (1033)
With Selection.Font
.NameFarEast = "SimSun"
.NameAscii = tofont$
.NameOther = tofont$
.Name = tofont$
.Size = 10
.Bold = False
.Italic = False
.Underline = wdUnderlineNone
.UnderlineColor = wdColorAutomatic
.StrikeThrough = False
.DoubleStrikeThrough = False
.Outline = False
.Emboss = False
.Shadow = False
.Hidden = False
.SmallCaps = False
.AllCaps = False
.Color = wdColorAutomatic
.Engrave = False
.Superscript = False
.Subscript = False
.Spacing = 0
.Scaling = 100
.Position = 0
.Kerning = 0
.Animation = wdAnimationNone
.DisableCharacterSpaceGrid = False
.EmphasisMark = wdEmphasisMarkNone
.SizeBi = 12
.NameBi = tofont$
.BoldBi = False
.ItalicBi = False
End With
For i = 1 To ucstr(1)
isetsuper = 0
If (ucstr(i + 1) < 0) Then
Selection.Font.Superscript = True
isetsuper = 1
s$ = ChrW(-ucstr(i + 1))
ElseIf (ucstr(i + 1) > 0) Then
s$ = ChrW(ucstr(i + 1))
Else
s$ = " "
End If
Selection.TypeText Text:=s$
If (isetsuper = 1) Then Selection.Font.Superscript = False
Next i
Application.Keyboard (1033)
End If
If (doentirefile = False) Then icheck = 1
Wend
Application.ScreenUpdating = True
Set bwutil = Nothing

End Sub
Sub ConvertBwLex2Unicode(fromfont$, tofont$, doentirefile)
Dim o As Object
Dim ucstr As Variant
ReDim ucstr(1024) As Long
If (doentirefile = True) Then Selection.HomeKey Unit:=wdStory
Set o = CreateObject("bwcom.document")
icheck = 0
While (icheck = 0)
Selection.Find.ClearFormatting
With Selection.Find
.Font.Name = fromfont$
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchKashida = False
.MatchDiacritics = False
.MatchAlefHamza = False
.MatchControl = False
.MatchByte = False
.CorrectHangulEndings = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = False
.MatchFuzzy = False
End With
If (Selection.Find.Execute = False) Then
icheck = 1
Else
istart = 1
iend = Selection.Characters.Count
ReDim ucstr(3 * iend + 2) As Long
ucstr(1) = iend
For i = istart To iend
ucstr(i + 1) = Asc(Selection.Characters(i))
Next i
o.BwLex2Unicode ucstr
Selection.Delete
Application.Keyboard (1033)
With Selection.Font
.NameFarEast = "SimSun"
.NameAscii = tofont$
.NameOther = tofont$
.Name = tofont$
.Size = 10
.Bold = False
.Italic = False
.Underline = wdUnderlineNone
.UnderlineColor = wdColorAutomatic
.StrikeThrough = False
.DoubleStrikeThrough = False
.Outline = False
.Emboss = False
.Shadow = False
.Hidden = False
.SmallCaps = False
.AllCaps = False
.Color = wdColorAutomatic
.Engrave = False
.Superscript = False
.Subscript = False
.Spacing = 0
.Scaling = 100
.Position = 0
.Kerning = 0
.Animation = wdAnimationNone
.DisableCharacterSpaceGrid = False
.EmphasisMark = wdEmphasisMarkNone
.SizeBi = 12
.NameBi = tofont$
.BoldBi = False
.ItalicBi = False
End With
For i = 1 To ucstr(1)
isetsuper = 0
If (ucstr(i + 1) < 0) Then
Selection.Font.Superscript = True
isetsuper = 1
s$ = ChrW(-ucstr(i + 1))
ElseIf (ucstr(i + 1) > 0) Then
s$ = ChrW(ucstr(i + 1))
Else
s$ = " "
End If
Selection.TypeText Text:=s$
If (isetsuper = 1) Then Selection.Font.Superscript = False
Next i
Application.Keyboard (1033)
End If
If (doentirefile = False) Then icheck = 1
Wend

Application.ScreenUpdating = True
Set bwutil = Nothing

End Sub
Sub ConvertAllBwGrk2Unicode()
ConvertBwGrk2Unicode "bwgrkl", "Arial Unicode MS", True
End Sub
Sub ConvertAllBwHeb2Unicode()
ConvertBwHeb2Unicode "bwhebb", "SBL Hebrew", True
End Sub
Sub ConvertAllBwLex2Unicode()
ConvertBwLex2Unicode "bwlexs", "Arial Unicode MS", True
End Sub
Sub ConvertAllBwSym2Unicode()
ConvertBwSym2Unicode "bwsymbs", "Arial Unicode MS", True
End Sub
Sub ConvertNextBwGrk2Unicode()
ConvertBwGrk2Unicode "bwgrkl", "Arial Unicode MS", False
End Sub
Sub ConvertNextBwHeb2Unicode()
ConvertBwHeb2Unicode "bwhebb", "SBL Hebrew", False
End Sub
Sub ConvertNextBwLex2Unicode()
ConvertBwLex2Unicode "bwlexs", "Arial Unicode MS", False
End Sub
Sub ConvertNextBwSym2Unicode()
ConvertBwSym2Unicode "bwsymbs", "Arial Unicode MS", False
End Sub