$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]$i Write-Host $sCurChar $sCurLabel = [string]$sCurChar If($sCurLabel -contains " ") { } ElseIf($sCurLabel -contains "") { } Else { If( Test-Path mychar.txt ) { Remove-Item mychar.txt } Add-Content mychar.txt $sCurLabel Write-Host $sCurLabel $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 0x0020 0x007F "Arial" #Basic Latin 2580 259F Block Elements outputPNG 0x0600 0x06FF "Andalus" #Arabic 2F00 2FDF Kangxi Radicals
The basic lating characters seem to convert fine with the use of [char]0xCODE. The arabic range however always seems to be converted to a '?' for every hexadecimal code in that range. I tried changing fonts and using Arial or Andulus however the problem seems to be occurring before the use of the ImageMagick command in the actual conversion using [char] which for some reason doesn't seem to convert the Arabic codes to their corresponding character.
Example output:
C:\ImageMagick\convert.exe -background transparent -fill hsb(0,0,0) -font Andalus -density 90 -pointsize 18 -gravity center label:"@mychar.txt" C:\Users\erics_0 00\Desktop\Output\Chars\6FB.png ? ? C:\ImageMagick\convert.exe -background transparent -fill hsb(0,0,0) -font Andalus -density 90 -pointsize 18 -gravity center label:"@mychar.txt" C:\Users\erics_0 00\Desktop\Output\Chars\6FC.png ? ? C:\ImageMagick\convert.exe -background transparent -fill hsb(0,0,0) -font Andalus -density 90 -pointsize 18 -gravity center label:"@mychar.txt" C:\Users\erics_0 00\Desktop\Output\Chars\6FD.png ? ? C:\ImageMagick\convert.exe -background transparent -fill hsb(0,0,0) -font Andalus -density 90 -pointsize 18 -gravity center label:"@mychar.txt" C:\Users\erics_0 00\Desktop\Output\Chars\6FE.png ? ? C:\ImageMagick\convert.exe -background transparent -fill hsb(0,0,0) -font Andalus -density 90 -pointsize 18 -gravity center label:"@mychar.txt" C:\Users\erics_0 00\Desktop\Output\Chars\6FF.png
Thank you...
- Edited by S.e.p.y 58 minutes ago