Font symbols report
This commit is contained in:
parent
81ea41e5c9
commit
7ab49f99e3
6 changed files with 122 additions and 15 deletions
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
|
||||
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Configuration" script:language="StarBasic" script:moduleType="normal">Public Const redactionExtensionName As String = "cleanAndValidate"
|
||||
Public Const redactionExtensionVersion = "0.9.1"
|
||||
Public Const redactionExtensionVersion = "0.9.2"
|
||||
Function initRedactionConfiguration()
|
||||
On Error Goto exceptionHandler
|
||||
Dim regFactory As Object
|
||||
|
|
|
@ -242,6 +242,21 @@ Function getRussian(identifier As String) As String
|
|||
Case "chooseFontNameDialogDescription"
|
||||
getRussian = "Дважды кликните левой клавишей мыши на имя шрифта"
|
||||
Exit Function
|
||||
Case "fontReportInProgress"
|
||||
getRussian = "Составление отчёта о шрифте. Пожалуйста, подождите."
|
||||
Exit Function
|
||||
Case "symbolsInFontHeading"
|
||||
getRussian = "Символы в шрифте"
|
||||
Exit Function
|
||||
Case "symbolsInFontNotFound1"
|
||||
getRussian = "Символов в шрифте"
|
||||
Exit Function
|
||||
Case "symbolsInFontNotFound2"
|
||||
getRussian = "найдено не было."
|
||||
Exit Function
|
||||
Case "charFirstPage"
|
||||
getRussian = "Найден на стр."
|
||||
Exit Function
|
||||
Case Else
|
||||
getRussian = "Перевод не найден"
|
||||
End Select
|
||||
|
@ -466,6 +481,21 @@ Function getEnglish(identifier As String) As String
|
|||
Case "chooseFontNameDialogDescription"
|
||||
getEnglish = "Double-click the font name with the left mouse button."
|
||||
Exit Function
|
||||
Case "fontReportInProgress"
|
||||
getEnglish = "Preparing report. Please wait."
|
||||
Exit Function
|
||||
Case "symbolsInFontHeading"
|
||||
getEnglish = "Characters in font"
|
||||
Exit Function
|
||||
Case "symbolsInFontNotFound1"
|
||||
getEnglish = "No characters in font"
|
||||
Exit Function
|
||||
Case "symbolsInFontNotFound2"
|
||||
getEnglish = "found."
|
||||
Exit Function
|
||||
Case "charFirstPage"
|
||||
getEnglish = "Found on page"
|
||||
Exit Function
|
||||
Case Else
|
||||
getEnglish = "No translation"
|
||||
End Select
|
||||
|
@ -689,6 +719,21 @@ Function getCroatian(identifier As String) As String
|
|||
Case "chooseFontNameDialogDescription"
|
||||
getCroatian = "Dvaput kliknite naziv fonta lijevom tipkom miša."
|
||||
Exit Function
|
||||
Case "fontReportInProgress"
|
||||
getCroatian = "Izvještavanje o fontu. Molimo pričekajte."
|
||||
Exit Function
|
||||
Case "symbolsInFontHeading"
|
||||
getCroatian = "Znakovi fonta"
|
||||
Exit Function
|
||||
Case "symbolsInFontNotFound1"
|
||||
getCroatian = "Znakovi fonta"
|
||||
Exit Function
|
||||
Case "symbolsInFontNotFound2"
|
||||
getCroatian = "nije pronađeno"
|
||||
Exit Function
|
||||
Case "charFirstPage"
|
||||
getCroatian = "Pronađeno na stranici"
|
||||
Exit Function
|
||||
Case Else
|
||||
getCroatian = "No translation"
|
||||
End Select
|
||||
|
@ -912,6 +957,21 @@ Function getSerbian(identifier As String) As String
|
|||
Case "chooseFontNameDialogDescription"
|
||||
getSerbian = "Двапут кликните на назив фонта левим дугметом миша."
|
||||
Exit Function
|
||||
Case "fontReportInProgress"
|
||||
getSerbian = "Припрема извештаја. Сачекајте."
|
||||
Exit Function
|
||||
Case "symbolsInFontHeading"
|
||||
getSerbian = "Знакови фонта"
|
||||
Exit Function
|
||||
Case "symbolsInFontNotFound1"
|
||||
getSerbian = "Знакови фонта"
|
||||
Exit Function
|
||||
Case "symbolsInFontNotFound2"
|
||||
getSerbian = "није пронађено"
|
||||
Exit Function
|
||||
Case "charFirstPage"
|
||||
getSerbian = "Пронађено на страници"
|
||||
Exit Function
|
||||
Case Else
|
||||
getSerbian = "No translation"
|
||||
End Select
|
||||
|
@ -1135,6 +1195,21 @@ Function getBosnian(identifier As String) As String
|
|||
Case "chooseFontNameDialogDescription"
|
||||
getBosnian = "Dvaput kliknite naziv fonta lijevom tipkom miša."
|
||||
Exit Function
|
||||
Case "fontReportInProgress"
|
||||
getBosnian = "Izvještavanje o fontu. Molimo pričekajte."
|
||||
Exit Function
|
||||
Case "symbolsInFontHeading"
|
||||
getBosnian = "Znakovi fonta"
|
||||
Exit Function
|
||||
Case "symbolsInFontNotFound1"
|
||||
getBosnian = "Znakovi fonta"
|
||||
Exit Function
|
||||
Case "symbolsInFontNotFound2"
|
||||
getBosnian = "nije pronađeno"
|
||||
Exit Function
|
||||
Case "charFirstPage"
|
||||
getBosnian = "Pronađeno na stranici"
|
||||
Exit Function
|
||||
Case Else
|
||||
getBosnian = "No translation"
|
||||
End Select
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
|
||||
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Validation" script:language="StarBasic">Sub markval11
|
||||
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Validation" script:language="StarBasic">Sub markval12
|
||||
|
||||
End Sub
|
||||
|
||||
|
@ -562,10 +562,15 @@ Sub fontReportButton
|
|||
Dim targetFontName As String
|
||||
targetFontName = fontDialog.model.Tag
|
||||
If targetFontName="0" or targetFontName="" Then
|
||||
statusIndicator.end()
|
||||
Exit sub
|
||||
EndIf
|
||||
getCharsInFont(targetFontName)
|
||||
Dim FileName As String
|
||||
FileName = getCharsInFont(targetFontName)
|
||||
statusIndicator.end()
|
||||
If FileName <> "" Then
|
||||
openReport(FileName)
|
||||
EndIf
|
||||
End Sub
|
||||
|
||||
Sub onSelectFont(oEvent)
|
||||
|
@ -605,9 +610,11 @@ Function getODGFontNames() As Variant
|
|||
enum2 = enum1Element.createEnumeration
|
||||
While enum2.hasMoreElements
|
||||
thisPortion = enum2.nextElement
|
||||
fontName = thisPortion.CharFontName
|
||||
If NOT fontIsAlreadyFound(fontNames, fontName) Then
|
||||
If Len(thisPortion.String) > 0 Then
|
||||
fontName = thisPortion.CharFontName
|
||||
If NOT fontIsAlreadyFound(fontNames, fontName) Then
|
||||
AddToArray(fontNames, fontName)
|
||||
EndIf
|
||||
EndIf
|
||||
Wend
|
||||
EndIf
|
||||
|
@ -673,8 +680,9 @@ Sub addToArray(xArray(),vNextElement)
|
|||
xArray(iUB) = vNextElement
|
||||
End Sub
|
||||
|
||||
Sub getCharsInFont(fontName As String)
|
||||
Function getCharsInFont(fontName As String) As String
|
||||
Dim resultArray() As String
|
||||
Dim pageNums() As Long
|
||||
Dim firstPages() As Long
|
||||
Dim resultString As String
|
||||
Dim pages As Object
|
||||
|
@ -712,6 +720,7 @@ Sub getCharsInFont(fontName As String)
|
|||
fontChar = Hex(Asc(Mid(resultString,k+1,1)))
|
||||
If NOT IsInArray(resultArray,fontChar) Then
|
||||
AddToArray(resultArray(), fontChar)
|
||||
AddToArray(pageNums(), i + 1)
|
||||
EndIf
|
||||
Next k
|
||||
EndIf
|
||||
|
@ -722,7 +731,7 @@ Sub getCharsInFont(fontName As String)
|
|||
Next i
|
||||
resultString = ""
|
||||
For i = LBound(resultArray) To UBound(resultArray)
|
||||
resultString = resultString & "<a href='https://unicode-table.com/ru/" & resultArray(i) & "'" & ">https://unicode-table.com/ru/" & resultArray(i) & "</a><br>" & Chr(10)
|
||||
resultString = resultString & "<a href='https://unicode-table.com/ru/" & resultArray(i) & "'" & ">https://unicode-table.com/ru/" & resultArray(i) & "</a> " & getTranslation("charFirstPage") & " " & pageNums(i) & "<br>" & Chr(10)
|
||||
Next i
|
||||
|
||||
If resultString <> "" Then
|
||||
|
@ -737,12 +746,35 @@ Sub getCharsInFont(fontName As String)
|
|||
FileName = path & "/symbolsInFont" & fontName & ".html"
|
||||
n = FreeFile() 'Next free file number
|
||||
Open FileName For Output Access Read Write As #n 'Open for read/write
|
||||
Print #n, "<html><body><p>Symbols in font "& fontName &":</p>"&resultString &"</body><html>"
|
||||
Print #n, "<html><head><title>" & getTranslation("symbolsInFontHeading") & " "& fontName & "</title></head><body><h2>" & getTranslation("symbolsInFontHeading") & " "& fontName &":</h2>"&resultString &"</body></html>"
|
||||
Close #n
|
||||
MsgBox "Отчёт о найденных символах в шрифте "& fontName &" можно открыть в " & FileName
|
||||
Else
|
||||
MsgBox "Символов в шрифте " & fontName & " найдено не было"
|
||||
EndIf
|
||||
End Sub
|
||||
getCharsInFont = FileName
|
||||
Exit Function
|
||||
|
||||
Else
|
||||
MsgBox getTranslation("symbolsInFontNotFound1") & " " & fontName & " " & getTranslation("symbolsInFontNotFound2")
|
||||
getCharsInFont = ""
|
||||
Exit Function
|
||||
EndIf
|
||||
End Function
|
||||
|
||||
|
||||
sub openReport(fileName As String)
|
||||
dim document as object
|
||||
dim dispatcher as object
|
||||
Dim path As String
|
||||
Dim tmpName As String
|
||||
Dim oldName As String
|
||||
document = ThisComponent.CurrentController.Frame
|
||||
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
|
||||
dim args1(1) as new com.sun.star.beans.PropertyValue
|
||||
args1(0).Name = "URL"
|
||||
args1(0).Value = fileName
|
||||
args1(1).Name = "FilterName"
|
||||
args1(1).Value = "HTML (StarWriter)"
|
||||
dispatcher.executeDispatch(document, ".uno:Open", "", 0, args1())
|
||||
If FileExists(tmpName) Then
|
||||
Kill(tmpName)
|
||||
End If
|
||||
End Sub
|
||||
</script:module>
|
|
@ -1,4 +1,4 @@
|
|||
def releaseVersion = "0.9.1"
|
||||
def releaseVersion = "0.9.2"
|
||||
task oxt(type: Zip) {
|
||||
dependsOn = [ 'setVersion','setVersionInBasicCode' ]
|
||||
from './'
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<description xmlns="http://openoffice.org/extensions/description/2006" xmlns:dep="http://openoffice.org/extensions/description/2006" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<identifier value="pro.litvinovg.Redaction"/>
|
||||
<version value="0.9.1"/>
|
||||
<version value="0.9.2"/>
|
||||
<platform value="all"/>
|
||||
<display-name>
|
||||
<name lang="en">Cleaning and validation documents for publishing in html and epub with pagination</name>
|
||||
|
|
BIN
translations.ods
BIN
translations.ods
Binary file not shown.
Loading…
Add table
Reference in a new issue