OK, jianwt, I am sorry, I made a mistake with that code. Sorry, I was in a hurry and I did not test it properly !!!
You could repeat that test with a different command, please try -
$> ./project1 --part=fang
Attached is a second version that works as it should. You can recompile with is code and try again. But the above test should work. The test command takes three options -
- --file=<filename> broken in your version
- --part=<part of font name> Works for me.
- --name=<font name> works for me.
Please either try again, with the existing copy and the new command I mention above. OR, recompile and try the original command.
Again, sorry for my mistake.
The 245 fonts is how many fonts were found on your system by the cache. You have less than I would expect, my standard Debian install has something like 2900. So, that says to me, maybe you don't have the default fonts we are assuming are present ?
> I fill in SIMFANG.TTF because when I paste the font into the linux system, it becomes uppercase.
Wow, I have no idea why that would happen. But my tests seemed to indicate the FontCache is case insensitive. If the above tests don't show us anything interesting, just as another thing to try, please do this -
$> cp ~/.fonts/SIMFANG.TTF ~/.fonts/simfang.ttf
And then run the above experiments. I don't think this will make any difference but please try, just in case.
And another experiment, if you are still not getting an answer from projet1, try this -
$> sudo cp ~/.fonts/simfang.ttf /usr/local/share/fonts/truetype/.
You will have to enter the root password when prompted. Please don't do this if you have had a positive response to the experiments above here.
Davo
ps, when I run that command, it looks like this -
dbannon@dell:~/Pascal/fcl-pdf/TestCache$ ./project1 --part=fang
Found 2948 fonts.
Name - [FangSong]
File - [/home/dbannon/.fonts/simfang.ttf]
Regular
EDIT: forgot the attachment !