Converting Syriac to an image.
Posted: 2015-07-11T17:08:51-07:00
Code: Select all
$sOutputDir = "C:\Users\erics_000\Desktop\Output"
$sCharsDir = "$sOutputDir\Chars"
$sCombDir = "$sOutputDir\Comb"
$sImageMagickHome = "C:\ImageMagick"
$sImageMagickConv = "$sImageMagickHome\convert.exe"
New-Item -ItemType Directory -Force -Path $sOutputDir
New-Item -ItemType Directory -Force -Path $sCharsDir
New-Item -ItemType Directory -Force -Path $sCombDir
Function outputPNG( $begin, $end, $font )
{
for ( $i = $begin; $i -le $end; $i++ )
{
$sCurChar = [char]::ConvertFromUtf32($i)
If($sCurLabel -contains " ")
{
}
ElseIf($sCurLabel -contains "")
{
}
Else
{
If( Test-Path mychar.txt )
{
Remove-Item mychar.txt
}
Add-Content -Encoding UTF8 mychar.txt $sCurChar
$sCurFileName = [string]"{0:X0000}" -f $i+".png"
$sImageMagickArgs = @('-background', 'transparent',
'-fill', 'hsb(0,0,0)',
'-font', "$font",
'-density','90',
'-pointsize', '18',
'-gravity', 'center',
'label:@mychar.txt',
"$sCharsDir\$sCurFileName")
Write-Host $sImageMagickConv $sImageMagickArgs
& $sImageMagickConv $sImageMagickArgs
}
}
}
outputPNG 0x0700 0x074F "Unifont" #Syriac
https://onedrive.live.com/redir?resid=D ... =folder%2c
Thank you...