Why won't perl/ptkdb honor the ptkdb*<property> entries I have in .Xdefaults? - perl

PLATFORM=linux_2.6.32_64
ptkdb: perl-5.18.2-gcc481/lib/5.18.2
I'm trying/failing to get ptkdb to use the font def I placed in .Xdefaults for it. This is the entry in .Xdefaults...
ptkdb*font: -adobe-courier-medium-*-18-*-*-*-*-*-*-*
I "constructed" that font name using "xfontsel" and am assuming it's valid.
I then ran "xrdb ~/.Xdefaults"
I copied ~/Xdefaults to ~/Xresources
When I run perl using the debugger (perl -d:ptkdb myscript.pl) it sticks to the same, small font that I want to change.
Can anyone see what I'm doing wrong ?

My bad. I transcribed the font name from xfontsel incorrectly. This worked...
-adobe-courier-medium-r-normal-*-14-*-*-*-*-*-*
(I missed the "-normal-")

Related

Error using text2image Font Exocet Light failed with 223518 hits = 99.94% when trying to build image file using Diablo 2 font

I am running tesseract on windows 11 using the command prompt.
The text file is my training data. Words that I want to turn into images.
The output is the next step in the Tesseract process for training my font.
I am saying find fonts but I only have one font in the folder.
text2image --text="C:\PythonProjects\DiabloTesseractTrainFont\text.txt" --outputbase="C:\PythonProjects\DiabloTesseractTrainFont\Output\Dia.font.exp0" --fontconfig_tmpdir="C:\PythonProjects\DiabloTesseractTrainFont" --find_fonts --fonts_dir="C:\PythonProjects\DiabloTesseractTrainFont\Diablo Fonts"
The result:
Total chars = 223645
Font Exocet Light failed with 223518 hits = 99.94%
Not sure why it fails. I have built something similar to this before. I have tried with a font file that I know has worked and it does the exact same thing.
Any help would be appreciated.
I solved it. In the text file, there were some characters that had been changed when I read them into python. I believe they used to be bullet points but when I read the file I had implemented in python ASCII encoding and ignore errors. I figured that those characters would be removed. I was wrong. Those bullet points were replaced with text that said PAD. I found it in notepad++ and highlighted one of them and then replaced them with a space. Note in Notepad++ when I did the replace it did not have anything in the find field but it still replaced all of them. Now it compiles just fine. I was stuck for many hours I hope this helps someone.

FileMaker Error: PDF could not be created on this disk

I don't really know if this would be a good place to ask this question, but FileMaker's forums haven't really been all that helpful. Our graphics department recently has been having issues with a script that they have been using for a few years now, and it just stopped working. I know nothing about FileMaker's language and have never used it before, I've just been asked to try and get it figured out.
The version that we are using is Advanced Pro 18.
Here is a snapshot of the script that is being run
This is the error it produces:
Any help would be appreciated, Thanks!
Check, if there is any font used in layout is missing in their computer.
If there are any fonts with upper case extension (.TTF), change it to lower case (.ttf)
It it is not the case, try Arial font for all the fields in the layout.
Make sure you have enough space.
Make sure your pdf document with the same name is not open.
Reinstall your pdf reader.
Suggestion: You can make the script step more simple.
You should use full file path to set the $Filename variable in line 7 and line 18, like these:
in Windows:
Set Variable [$Filename; Value: "filewin:/DriveLetter:/DirectoryName/" & Log Book::calculate job # & ".pdf"]
or in Mac:
Set Variable [$Filename; Value: "filemac:/VolumeName/DirectoryName/" & Log Book::calculate job # & ".pdf"]
One late additional note: make sure the filename is free of "prohibited" characters. If the string produced by Log Book::calculate job # included a "/" character, for example, you'd likely see the same error message.

Persian font encoding in m-files on Matlab [duplicate]

I'd like to use Unicode characters in comments in a MATLAB source file. This seems to work when I write the text; however, if I close the file and reload it, "unusual" characters have been turned into question marks. I guess MATLAB is saving the file as ASCII.
Is there any way to tell MATLAB to use UTF-8 instead?
According to http://www.mathworks.de/matlabcentral/newsreader/view_thread/238995
feature('DefaultCharacterSet', 'UTF8')
will change the encoding to UTF-8. You can put the line above in your startup.m file.
How the MATLAB Process Uses Locale Settings shows how to set the encoding for different platforms. Use
feature('DefaultCharacterSet')
You can read more about this undocumented function here. See also this Matlab Central thread for other options.
Mac OSX only!
As I found solution which worked in my case I want to share it.
Mathworks advises here to use slCharacterEncoding(encoding) in order to change the encoding as desired, but for the OSX this does not solve the issue exactly as the feature('DefaultCharacterSet') in accepted answer does not do it. What helped me to get the UTF-8 encoding set for opening and saving .m files was the following link on MATLAB answers:
https://www.mathworks.com/matlabcentral/answers/12422-macosx-encoding-problem
Matlab seems to ignore any value set in slCharacterEncoding(encoding) or feature('DefaultCharacterSet') but uses region set in System Preferences -> Language & Region. After checking which region is selected in our case then it is possible to define the actual encoding in the hidden configuration file in
$matlabroot/bin/lcdata.xml
This directory can be opened by getting to the Applications and after right click on Matlab by selecting Show Package Contents as on screenshot (here in German)
For example for German default ISO-8859-1 it is possible to adjust it by changing the respective line in the file lcdata.xml:
<locale name="de_DE" encoding="ISO-8859-1" xpg_name="de_DE.ISO8859-1">
to:
<locale name="de_DE" encoding="UTF-8" xpg_name="de_DE.UTF-8">
If the region which is selected is not present in the lcdata.xml file this will not work.
Hope this helps!
The solution provided here worked for me on Windows with R2018a.
In case link doesn't work: the idea is to use file matlabroot/bin/lcdata.xml to configure an alias for encoding name (some explanation can be found in this very file in the comments):
<codeset>
<encoding name="UTF-8">
<encoding_alias name="windows-1252" />
</encoding>
</codeset>
You would use your own value instead of windows-1252, currently used encoding can be obtained by running feature('locale').
Although, if you use Unicode characters in help comments, the help browser does not recognize them, as well as console window output.
For Mac OS users, Jendker's solution really helps!!! Thanks a lot first.
Recap here.
Check the default language in Matlab by typing in the command window getenv('LANG'). Mine returned en_US.ISO8859-1.
In the Application directory find Matlab, show its package contents. Go to bin, open lcdata.xml as an administrator, locate the corresponding xpg_name, in my case en_US.ISO8859-1. Change encoding in the same line to UTF-8. Save it.
Restart Matlab, and it's all done!

Unicode characters in MATLAB source files

I'd like to use Unicode characters in comments in a MATLAB source file. This seems to work when I write the text; however, if I close the file and reload it, "unusual" characters have been turned into question marks. I guess MATLAB is saving the file as ASCII.
Is there any way to tell MATLAB to use UTF-8 instead?
According to http://www.mathworks.de/matlabcentral/newsreader/view_thread/238995
feature('DefaultCharacterSet', 'UTF8')
will change the encoding to UTF-8. You can put the line above in your startup.m file.
How the MATLAB Process Uses Locale Settings shows how to set the encoding for different platforms. Use
feature('DefaultCharacterSet')
You can read more about this undocumented function here. See also this Matlab Central thread for other options.
Mac OSX only!
As I found solution which worked in my case I want to share it.
Mathworks advises here to use slCharacterEncoding(encoding) in order to change the encoding as desired, but for the OSX this does not solve the issue exactly as the feature('DefaultCharacterSet') in accepted answer does not do it. What helped me to get the UTF-8 encoding set for opening and saving .m files was the following link on MATLAB answers:
https://www.mathworks.com/matlabcentral/answers/12422-macosx-encoding-problem
Matlab seems to ignore any value set in slCharacterEncoding(encoding) or feature('DefaultCharacterSet') but uses region set in System Preferences -> Language & Region. After checking which region is selected in our case then it is possible to define the actual encoding in the hidden configuration file in
$matlabroot/bin/lcdata.xml
This directory can be opened by getting to the Applications and after right click on Matlab by selecting Show Package Contents as on screenshot (here in German)
For example for German default ISO-8859-1 it is possible to adjust it by changing the respective line in the file lcdata.xml:
<locale name="de_DE" encoding="ISO-8859-1" xpg_name="de_DE.ISO8859-1">
to:
<locale name="de_DE" encoding="UTF-8" xpg_name="de_DE.UTF-8">
If the region which is selected is not present in the lcdata.xml file this will not work.
Hope this helps!
The solution provided here worked for me on Windows with R2018a.
In case link doesn't work: the idea is to use file matlabroot/bin/lcdata.xml to configure an alias for encoding name (some explanation can be found in this very file in the comments):
<codeset>
<encoding name="UTF-8">
<encoding_alias name="windows-1252" />
</encoding>
</codeset>
You would use your own value instead of windows-1252, currently used encoding can be obtained by running feature('locale').
Although, if you use Unicode characters in help comments, the help browser does not recognize them, as well as console window output.
For Mac OS users, Jendker's solution really helps!!! Thanks a lot first.
Recap here.
Check the default language in Matlab by typing in the command window getenv('LANG'). Mine returned en_US.ISO8859-1.
In the Application directory find Matlab, show its package contents. Go to bin, open lcdata.xml as an administrator, locate the corresponding xpg_name, in my case en_US.ISO8859-1. Change encoding in the same line to UTF-8. Save it.
Restart Matlab, and it's all done!

Localizable.strings woes

My Localizable.strings file has somehow been corrupted and I don't know how to restore it.
If I open it as a Plain Text File it starts with weird characters that I can't copy here.
If I leave the file be the app builds. If I make any changes either the values aren't interpreted properly or I get an error at compile time.
Localizable.strings: Conversion of string failed. The string is empty.
Command /Developer/Library/Xcode/Plug-ins/CoreBuildTasks.xcplugin/Contents/Resources/copystrings failed with exit code 1
I suspect this is an encoding problem but I don't know how it happened (maybe SVN is to blame?) nor how to solve it. Any tips will be much more appreciated.
I have issues with the same file that sound very similar to your own. What happens for me is that Xcode doesn't know the correct file formating. I often get this when rearranging the project and I remove and re-add this file to the Xcode project. When I re-add the file, its encoding gets set to something like Western Roman which can't seem to render anything other than ASCII.
Here's what I do to fix the problem:
In Xcode select the Localizable.stings file in the Groups&Files panel.
Do a Get Info on that file.
On the info panel select the General tab.
In that tab go to the File Encoding and change its value.
The last step is where the trick lies as you now have to guess the right encoding. I find that for most European languages that "Unicode (UTF-8)" works. And for Asian languages I find that "Unicode (UTF-16/32)" are the ones to try.
I just had that error because I forgot a semicolon. Took me a while to figure it out. Seems like a really ambiguous compiler error but the fix was simple.
Make sure in File-Get Info, that UTF-16 is selected. If it's set to none or UTF-8 as encoding then you need to change it. If your characters have spaces between them then you choose to "re-interpret" the file as UTF-16. If there are weird characters in the file, then you need to remove them.
Execpt the UTF-8 problem, sometimes you still have to check the content in case if there are some syntax problems.
Use the following Regular Expression to verify your text line by line, if there's any line not matched, there must be a problem.
"(.+?)"="(.+?)";
You can use the plutil command line tool. Without options or with the -lint option, it checks the syntax of the file given as argument. It will tell you more precisely where the error is.
This happens to me when there is a missing quote or something not right with the file. MOst commonly, since my language files are done by another team member, he tends to forget a quote or something. Usually XCode shows an error on that line, sometimes it does'nt and just throws "Corrupted data" error.
Double check if all your strings are properly closed in quotes
Open the file in Xcode.
Right click it in Project Navigator.
Select Open as -> ASCII Property List