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"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
|
<!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"
|
<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()
|
Function initRedactionConfiguration()
|
||||||
On Error Goto exceptionHandler
|
On Error Goto exceptionHandler
|
||||||
Dim regFactory As Object
|
Dim regFactory As Object
|
||||||
|
|
|
@ -242,6 +242,21 @@ Function getRussian(identifier As String) As String
|
||||||
Case "chooseFontNameDialogDescription"
|
Case "chooseFontNameDialogDescription"
|
||||||
getRussian = "Дважды кликните левой клавишей мыши на имя шрифта"
|
getRussian = "Дважды кликните левой клавишей мыши на имя шрифта"
|
||||||
Exit Function
|
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
|
Case Else
|
||||||
getRussian = "Перевод не найден"
|
getRussian = "Перевод не найден"
|
||||||
End Select
|
End Select
|
||||||
|
@ -466,6 +481,21 @@ Function getEnglish(identifier As String) As String
|
||||||
Case "chooseFontNameDialogDescription"
|
Case "chooseFontNameDialogDescription"
|
||||||
getEnglish = "Double-click the font name with the left mouse button."
|
getEnglish = "Double-click the font name with the left mouse button."
|
||||||
Exit Function
|
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
|
Case Else
|
||||||
getEnglish = "No translation"
|
getEnglish = "No translation"
|
||||||
End Select
|
End Select
|
||||||
|
@ -689,6 +719,21 @@ Function getCroatian(identifier As String) As String
|
||||||
Case "chooseFontNameDialogDescription"
|
Case "chooseFontNameDialogDescription"
|
||||||
getCroatian = "Dvaput kliknite naziv fonta lijevom tipkom miša."
|
getCroatian = "Dvaput kliknite naziv fonta lijevom tipkom miša."
|
||||||
Exit Function
|
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
|
Case Else
|
||||||
getCroatian = "No translation"
|
getCroatian = "No translation"
|
||||||
End Select
|
End Select
|
||||||
|
@ -912,6 +957,21 @@ Function getSerbian(identifier As String) As String
|
||||||
Case "chooseFontNameDialogDescription"
|
Case "chooseFontNameDialogDescription"
|
||||||
getSerbian = "Двапут кликните на назив фонта левим дугметом миша."
|
getSerbian = "Двапут кликните на назив фонта левим дугметом миша."
|
||||||
Exit Function
|
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
|
Case Else
|
||||||
getSerbian = "No translation"
|
getSerbian = "No translation"
|
||||||
End Select
|
End Select
|
||||||
|
@ -1135,6 +1195,21 @@ Function getBosnian(identifier As String) As String
|
||||||
Case "chooseFontNameDialogDescription"
|
Case "chooseFontNameDialogDescription"
|
||||||
getBosnian = "Dvaput kliknite naziv fonta lijevom tipkom miša."
|
getBosnian = "Dvaput kliknite naziv fonta lijevom tipkom miša."
|
||||||
Exit Function
|
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
|
Case Else
|
||||||
getBosnian = "No translation"
|
getBosnian = "No translation"
|
||||||
End Select
|
End Select
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
|
<!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
|
End Sub
|
||||||
|
|
||||||
|
@ -562,10 +562,15 @@ Sub fontReportButton
|
||||||
Dim targetFontName As String
|
Dim targetFontName As String
|
||||||
targetFontName = fontDialog.model.Tag
|
targetFontName = fontDialog.model.Tag
|
||||||
If targetFontName="0" or targetFontName="" Then
|
If targetFontName="0" or targetFontName="" Then
|
||||||
|
statusIndicator.end()
|
||||||
Exit sub
|
Exit sub
|
||||||
EndIf
|
EndIf
|
||||||
getCharsInFont(targetFontName)
|
Dim FileName As String
|
||||||
|
FileName = getCharsInFont(targetFontName)
|
||||||
statusIndicator.end()
|
statusIndicator.end()
|
||||||
|
If FileName <> "" Then
|
||||||
|
openReport(FileName)
|
||||||
|
EndIf
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Sub onSelectFont(oEvent)
|
Sub onSelectFont(oEvent)
|
||||||
|
@ -605,10 +610,12 @@ Function getODGFontNames() As Variant
|
||||||
enum2 = enum1Element.createEnumeration
|
enum2 = enum1Element.createEnumeration
|
||||||
While enum2.hasMoreElements
|
While enum2.hasMoreElements
|
||||||
thisPortion = enum2.nextElement
|
thisPortion = enum2.nextElement
|
||||||
|
If Len(thisPortion.String) > 0 Then
|
||||||
fontName = thisPortion.CharFontName
|
fontName = thisPortion.CharFontName
|
||||||
If NOT fontIsAlreadyFound(fontNames, fontName) Then
|
If NOT fontIsAlreadyFound(fontNames, fontName) Then
|
||||||
AddToArray(fontNames, fontName)
|
AddToArray(fontNames, fontName)
|
||||||
EndIf
|
EndIf
|
||||||
|
EndIf
|
||||||
Wend
|
Wend
|
||||||
EndIf
|
EndIf
|
||||||
Wend
|
Wend
|
||||||
|
@ -673,8 +680,9 @@ Sub addToArray(xArray(),vNextElement)
|
||||||
xArray(iUB) = vNextElement
|
xArray(iUB) = vNextElement
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Sub getCharsInFont(fontName As String)
|
Function getCharsInFont(fontName As String) As String
|
||||||
Dim resultArray() As String
|
Dim resultArray() As String
|
||||||
|
Dim pageNums() As Long
|
||||||
Dim firstPages() As Long
|
Dim firstPages() As Long
|
||||||
Dim resultString As String
|
Dim resultString As String
|
||||||
Dim pages As Object
|
Dim pages As Object
|
||||||
|
@ -712,6 +720,7 @@ Sub getCharsInFont(fontName As String)
|
||||||
fontChar = Hex(Asc(Mid(resultString,k+1,1)))
|
fontChar = Hex(Asc(Mid(resultString,k+1,1)))
|
||||||
If NOT IsInArray(resultArray,fontChar) Then
|
If NOT IsInArray(resultArray,fontChar) Then
|
||||||
AddToArray(resultArray(), fontChar)
|
AddToArray(resultArray(), fontChar)
|
||||||
|
AddToArray(pageNums(), i + 1)
|
||||||
EndIf
|
EndIf
|
||||||
Next k
|
Next k
|
||||||
EndIf
|
EndIf
|
||||||
|
@ -722,7 +731,7 @@ Sub getCharsInFont(fontName As String)
|
||||||
Next i
|
Next i
|
||||||
resultString = ""
|
resultString = ""
|
||||||
For i = LBound(resultArray) To UBound(resultArray)
|
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
|
Next i
|
||||||
|
|
||||||
If resultString <> "" Then
|
If resultString <> "" Then
|
||||||
|
@ -737,12 +746,35 @@ Sub getCharsInFont(fontName As String)
|
||||||
FileName = path & "/symbolsInFont" & fontName & ".html"
|
FileName = path & "/symbolsInFont" & fontName & ".html"
|
||||||
n = FreeFile() 'Next free file number
|
n = FreeFile() 'Next free file number
|
||||||
Open FileName For Output Access Read Write As #n 'Open for read/write
|
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
|
Close #n
|
||||||
MsgBox "Отчёт о найденных символах в шрифте "& fontName &" можно открыть в " & FileName
|
getCharsInFont = FileName
|
||||||
Else
|
Exit Function
|
||||||
MsgBox "Символов в шрифте " & fontName & " найдено не было"
|
|
||||||
EndIf
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
|
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>
|
</script:module>
|
|
@ -1,4 +1,4 @@
|
||||||
def releaseVersion = "0.9.1"
|
def releaseVersion = "0.9.2"
|
||||||
task oxt(type: Zip) {
|
task oxt(type: Zip) {
|
||||||
dependsOn = [ 'setVersion','setVersionInBasicCode' ]
|
dependsOn = [ 'setVersion','setVersionInBasicCode' ]
|
||||||
from './'
|
from './'
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
<?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">
|
<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"/>
|
<identifier value="pro.litvinovg.Redaction"/>
|
||||||
<version value="0.9.1"/>
|
<version value="0.9.2"/>
|
||||||
<platform value="all"/>
|
<platform value="all"/>
|
||||||
<display-name>
|
<display-name>
|
||||||
<name lang="en">Cleaning and validation documents for publishing in html and epub with pagination</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