I was recently playing with font files on Windows CE 6.0 (developing using C# Compact-Framework v2.0 and AddFontResource). After adding "Angsana New" (for Thai), I now find that the Angsana.ttf file I loaded cannot be deleted! I've tried everything I can think of including:
* Re-running my program and using RemoveFontResource
* Changing to another language that uses an in-built font or another I supply
* Renamed the file (which is allowed, why?
* Manually checking the registry to see if "Angsana" is referenced anywhere
* Power down the mobile device and back up again
* Loaded the Windows CE command prompt and used the command:
del /f Angsana.ttf
Curiously, I can the rename font freely file from "Angsana.ttf" to "Angsana_2.ttf"...but still not delete it. More interesting still is that if I copy Angsana.ttf (to create "Copy of Angsana.ttf") then the copy also cannot be deleted! This is a strong hint that there is some attribute or system process locking the file (and its' copies)...but what?
The error message from Explorer is:
"Cannot delete 'Angsana.ttf': There has been a sharing violation. The source or destination may be in use."
From command prompt the error is simply:
"Cannot remove Angsana.ttf"
What the heck is going on??
UPDATE: The file "Angsana.ttf" is in a folder called "Fonts". If I create a new folder called "Fred" on the same level as "Fonts", I can cut and paste the TTF file to the new folder. Now the new folder "Fred" can be deleted including the TTF file it contains (or if that fails, a power cycle allows the entire folder to be deleted)!
Seems like my mobile device is putting some sort of "lock" (is that the right terminology?) on the Fonts folder during boot-up.