如何将新字体应用于以特定字体书写的字符? [英] How to apply new font to characters written in a particular font?
问题描述
我正在编辑一些使用非Unicode字体以科普特语言编写的文本文件.我正在将文件转换为Unicode.
I am editing some text files written in Coptic language using non Unicode fonts. I am converting the files to Unicode.
我用三种字体写的文件代表发音方言. 我想创建一个宏来搜索非Unicode字符并将其替换为Unicode字符.
The files I were written using three fonts to represent pronunciation dialects. I want to create a macro to search and replace the non Unicode characters with Unicode ones.
我想限制搜索并将其替换为某些字体.我试图记录一个宏,但是字体选择没有记录.
I want to limit the search and replace to certain fonts. I tried to record a macro, but the font choices did not record.
最终结果将是,除了方言标记之外,还将其中一种字体中的字符(在字符中内置了方言标记)替换为Unicode字符.
The end result will be replacing the characters in one of the fonts (that had dialect marks built into the character) with a Unicode character in addition to the dialect mark separately.
是否可以修改下面的代码,以将搜索和替换功能限制为以特定字体书写的字符?
Is there a way to modify the code below to limit the search and replace function to the characters written in a particular font?
Sub aaaa()
'
' aaaa Macro
'
'
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "n"
.Replacement.Text = ChrW(11419) & ChrW(769)
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchKashida = False
.MatchDiacritics = False
.MatchAlefHamza = False
.MatchControl = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub
在哪里选择字体
最终结果
推荐答案
解决方案:
Sub twoo()
'
' twoo Macro
'
'
With Selection.Find
.Text = "n"
' Clear all previously set formatting for Find dialog box.
.ClearFormatting
' Set font to Find for replacement.
.Font.Name = "EXISTING FONT NAME"
' Clear all previously set formatting for Replace dialog box.
.Replacement.ClearFormatting
' Set font to Replace found font.
.Replacement.Font.Name = "NEW FONT NAME"
.Replacement.Text = ChrW(11419) & ChrW(769)
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchKashida = False
.MatchDiacritics = False
.MatchAlefHamza = False
.MatchControl = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub
这篇关于如何将新字体应用于以特定字体书写的字符?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!