Kusanagi Kouichi slash@ac.auone-net.jp writes:
@@ -962,6 +972,22 @@ static Family *find_family_from_any_name(const WCHAR *name) return NULL; }
+static Font *find_font_file(const char *file) +{
- if (file != NULL)
- {
Font *font;
LIST_FOR_EACH_ENTRY(font, &font_list, Font, entry)
{
if (font->file != NULL && strcmp(font->file, file) == 0)
return font;
}
- }
- return NULL;
+}
You can't compare files this way, different paths can point to the same file.
@@ -2927,7 +2988,8 @@ static BOOL get_fontdir( const char *unix_name, struct fontdir *fd ) DWORD type;
if (!ft_face) return FALSE;
- face = create_face( ft_face, 0, unix_name, NULL, 0, 0, FALSE );
- font.file = (char *)unix_name;
Don't do that.
On 2012-04-23 12:11:06 +0200, Alexandre Julliard wrote:
Kusanagi Kouichi slash@ac.auone-net.jp writes:
@@ -962,6 +972,22 @@ static Family *find_family_from_any_name(const WCHAR *name) return NULL; }
+static Font *find_font_file(const char *file) +{
- if (file != NULL)
- {
Font *font;
LIST_FOR_EACH_ENTRY(font, &font_list, Font, entry)
{
if (font->file != NULL && strcmp(font->file, file) == 0)
return font;
}
- }
- return NULL;
+}
You can't compare files this way, different paths can point to the same file.
This function finds font path, not file. So find_font_path would be more appropriate name.
@@ -2927,7 +2988,8 @@ static BOOL get_fontdir( const char *unix_name, struct fontdir *fd ) DWORD type;
if (!ft_face) return FALSE;
- face = create_face( ft_face, 0, unix_name, NULL, 0, 0, FALSE );
- font.file = (char *)unix_name;
Don't do that.
-- Alexandre Julliard julliard@winehq.org
Kusanagi Kouichi slash@ac.auone-net.jp writes:
You can't compare files this way, different paths can point to the same file.
This function finds font path, not file. So find_font_path would be more appropriate name.
What's the point of doing this if it doesn't catch identical files?
On 2012-04-24 13:01:04 +0200, Alexandre Julliard wrote:
Kusanagi Kouichi slash@ac.auone-net.jp writes:
You can't compare files this way, different paths can point to the same file.
This function finds font path, not file. So find_font_path would be more appropriate name.
What's the point of doing this if it doesn't catch identical files?
I thought it could be used to implement RemoveFontResourceEx.
-- Alexandre Julliard julliard@winehq.org
Kusanagi Kouichi slash@ac.auone-net.jp writes:
On 2012-04-24 13:01:04 +0200, Alexandre Julliard wrote:
Kusanagi Kouichi slash@ac.auone-net.jp writes:
You can't compare files this way, different paths can point to the same file.
This function finds font path, not file. So find_font_path would be more appropriate name.
What's the point of doing this if it doesn't catch identical files?
I thought it could be used to implement RemoveFontResourceEx.
That's precisely the sort of thing where you need a proper file identity comparison and not just a path string check.