我正在使用LibreOffice(而不是microsoft Word,因为着色变音符号对所有它们都使用单一颜色),并且我试图将这些阿拉伯变音符号更改为每种颜色都具有特定颜色使用两种方法:
- 使用编辑=>查找并替换(或 Ctrl + H ):
- 使用工具=>宏=>运行宏:
Sub ChangeDiacriticColors
CrRepDesc = ThisComponent.createReplaceDescriptor
CrRepDesc.searchRegularExpression = True
CrRepDesc.searchString = "َ" ' Unicode Character 'ARABIC FATHA' (U+064E)
FnAllRepDesc = ThisComponent.findAll(CrRepDesc)
for i = 0 to FnAllRepDesc.count-1
FoundTxt = FnAllRepDesc.getByIndex(i)
FoundTxt.CharColor = 255 ' Blue Color
next i
CrRepDesc = ThisComponent.createReplaceDescriptor
CrRepDesc.searchRegularExpression = True
CrRepDesc.searchString = "ٌ" 'Unicode Character 'ARABIC DAMMATAN' (U+064C)
FnAllRepDesc = ThisComponent.findAll(CrRepDesc)
for i = 0 to FnAllRepDesc.count-1
FoundTxt = FnAllRepDesc.getByIndex(i)
FoundTxt.CharColor = 65280 ' Green Color
next i
CrRepDesc = ThisComponent.createReplaceDescriptor
CrRepDesc.searchRegularExpression = True
CrRepDesc.searchString = "ِ" ' Unicode Character 'ARABIC KASRA' (U+0650)
FnAllRepDesc = ThisComponent.findAll(CrRepDesc)
for i = 0 to FnAllRepDesc.count-1
FoundTxt = FnAllRepDesc.getByIndex(i)
FoundTxt.CharColor = 16711680 ' Red Color
next i
End Sub
先前方法的缺点: 应用每种上述方法后,变音符的位置将发生变化,预计在其各自的原始位置中将有变音符。
预期结果将类似于下图(来自Adobe illustrator),变音符号在其位置(预期位置)分别着色。
PS:如果有更好的创建A4可打印文档的方法,我不介意更改LibreOffice方法