Changeset 213


Ignore:
Timestamp:
Dec 18, 2010, 12:41:53 AM (15 years ago)
Author:
dmik
Message:

jdk: Search for font files in directories where registered fonts from the OS/2 font palette reside. This causes JDK to pick up system fonts and eliminates the need to distribute any fonts with it.

Location:
trunk/openjdk/jdk
Files:
3 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/openjdk/jdk/make/sun/font/FILES_c.gmk

    r200 r213  
    115115ifeq ($(filter-out windows os2,$(PLATFORM)),)
    116116FILES_c_platform = fontpath.c
    117 ifneq ($(PLATFORM), os2) 
     117ifeq ($(PLATFORM), os2) 
     118FILES_c_platform += fontpath_os2.c
    118119# no D3D on OS/2
     120else
    119121FILES_cpp_platform = D3DTextRenderer.cpp
    120122endif
  • trunk/openjdk/jdk/make/sun/font/Makefile

    r202 r213  
    171171vpath %.cpp   $(SHARE_SRC)/native/$(PKGDIR)
    172172
     173ifeq ($(PLATFORM), os2) 
     174vpath %.c   $(PLATFORM_SRC_OS2)/native/$(PKGDIR)
     175endif
     176
    173177#
    174178# Fontmanager is headless (independent of X/Motif)
  • trunk/openjdk/jdk/src/windows/native/sun/font/fontpath.c

    r200 r213  
    3737#include <wchar.h>
    3838#include <minivcrt.h>
     39extern char *getOs2FontPath();
    3940#endif
    4041
     
    4344    char windir[BSIZE];
    4445    char sysdir[BSIZE];
     46#ifdef __WIN32OS2__
     47    char *fontpath;
     48#else
    4549    char fontpath[BSIZE*2];
     50#endif
    4651    char *end;
     52
     53#ifdef __WIN32OS2__
     54    /* Find out all folders containing registered fonts in OS/2 to let Java
     55     * pick them up */
     56    fontpath = getOs2FontPath();
     57    fontpath = fontpath ? realloc(fontpath, strlen(fontpath) + BSIZE*2)
     58                        : malloc(BSIZE*2);
     59    if (!fontpath)
     60        return NULL;
     61#endif
    4762
    4863    /* Locate fonts directories relative to the Windows System directory.
     
    6580    }
    6681
     82#ifdef __WIN32OS2__
     83    strcat(fontpath,sysdir);
     84#else
    6785    strcpy(fontpath,sysdir);
     86#endif
    6887    if (stricmp(sysdir,windir)) {
    6988        strcat(fontpath,";");
     
    7190    }
    7291
    73     return JNU_NewStringPlatform(env, fontpath);
     92    jstring ret = JNU_NewStringPlatform(env, fontpath);
     93#ifdef __WIN32OS2__
     94    free(fontpath);
     95#endif
     96
     97    return ret;
    7498}
    7599
Note: See TracChangeset for help on using the changeset viewer.