Skip to content

Commit

Permalink
Remove HelpDir preference
Browse files Browse the repository at this point in the history
There’s no need for this: help should always be installed in the right
place for the given build. We should not encourage FF to be installed
without help files, even if this will sometimes happen (e.g. when it’s
packaged, but in that case I’d expect a corresponding -doc package that
installs the help in the right place).

(Suppose a user on an increasingly-mythical multiuser system whose
sysadmin has installed FF but not the help files: in that case, let that
user install their own copy of FF, then they can be sure the help files
they install will actually match it.)
  • Loading branch information
rrthomas committed Oct 6, 2014
1 parent 9d88752 commit 43b52fa
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 52 deletions.
2 changes: 0 additions & 2 deletions fontforge/noprefs.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ extern int use_freetype_to_rasterize_fv; /* in bitmapchar.c */
/* UI preferences which we don't use, but will preserve to so we can read/write */
/* UI preference files without loss of data */
static char *xdefs_filename;
static char *helpdir=NULL; /* in uiutil.c */
static int splash=1;
static int cv_auto_goto=1;
static int OpenCharsInNewWindow=1;
Expand Down Expand Up @@ -243,7 +242,6 @@ static struct prefs_list {
},
extras[] = {
{ N_("ResourceFile"), pr_file, &xdefs_filename, NULL, NULL, 'R', NULL, 0, N_("When FontForge starts up, it loads the user interface theme from\nthis file. Any changes will only take effect the next time you start FontForge.") },
{ N_("HelpDir"), pr_file, &helpdir, NULL, NULL, 'H', NULL, 0, N_("The directory on your local system in which FontForge will search for help\nfiles. If a file is not found there, then FontForge will look for it on the net.") },
{ N_("SplashScreen"), pr_bool, &splash, NULL, NULL, 'S', NULL, 0, N_("Show splash screen on start-up") },
{ N_("GlyphAutoGoto"), pr_bool, &cv_auto_goto, NULL, NULL, '\0', NULL, 0, N_("Typing a normal character in the glyph view window changes the window to look at that character") },
{ N_("OpenCharsInNewWindow"), pr_bool, &OpenCharsInNewWindow, NULL, NULL, '\0', NULL, 0, N_("When double clicking on a character in the font view\nopen that character in a new window, otherwise\nreuse an existing one.") },
Expand Down
9 changes: 0 additions & 9 deletions fontforgeexe/prefs.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@ extern int new_em_size; /* in splineutil2.c */
extern int new_fonts_are_order2; /* in splineutil2.c */
extern int loaded_fonts_same_as_new; /* in splineutil2.c */
extern int use_second_indic_scripts; /* in tottfgpos.c */
extern char *helpdir; /* in uiutil.c */
static char *othersubrsfile = NULL;
extern MacFeat *default_mac_feature_map, /* from macenc.c */
*user_mac_feature_map;
Expand Down Expand Up @@ -301,7 +300,6 @@ static struct prefs_list {
/* GT: translated (which the user sees, and should probably have added spaces,*/
/* GT: and one untranslated which needs the current odd format */
{ N_("ResourceFile"), pr_file, &xdefs_filename, NULL, NULL, 'R', NULL, 0, N_("When FontForge starts up, it loads the user interface theme from\nthis file. Any changes will only take effect the next time you start FontForge.") },
{ N_("HelpDir"), pr_file, &helpdir, NULL, NULL, 'H', NULL, 0, N_("The directory on your local system in which FontForge will search for help\nfiles. If a file is not found there, then FontForge will look for it on the net.") },
{ N_("OtherSubrsFile"), pr_file, &othersubrsfile, NULL, NULL, 'O', NULL, 0, N_("If you wish to replace Adobe's OtherSubrs array (for Type1 fonts)\nwith an array of your own, set this to point to a file containing\na list of up to 14 PostScript subroutines. Each subroutine must\nbe preceded by a line starting with '%%%%' (any text before the\nfirst '%%%%' line will be treated as an initial copyright notice).\nThe first three subroutines are for flex hints, the next for hint\nsubstitution (this MUST be present), the 14th (or 13 as the\nnumbering actually starts with 0) is for counter hints.\nThe subroutines should not be enclosed in a [ ] pair.") },
{ N_("FreeTypeInFontView"), pr_bool, &use_freetype_to_rasterize_fv, NULL, NULL, 'O', NULL, 0, N_("Use the FreeType rasterizer (when available)\nto rasterize glyphs in the font view.\nThis generally results in better quality.") },
{ N_("FreeTypeAAFillInOutlineView"), pr_bool, &use_freetype_with_aa_fill_cv, NULL, NULL, 'O', NULL, 0, N_("When filling using freetype in the outline view,\nhave freetype render the glyph antialiased.") },
Expand Down Expand Up @@ -1043,16 +1041,9 @@ static void DefaultXUID(void) {
xuid = copy(buffer);
}

static void DefaultHelp(void) {
if ( helpdir==NULL ) {
helpdir = copy(getHelpDir());
}
}

static void PrefsUI_SetDefaults(void) {

DefaultXUID();
DefaultHelp();
local_encoding = DefaultEncoding();
}

Expand Down
13 changes: 2 additions & 11 deletions fontforgeexe/uiutil.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ extern void cygwin_conv_to_full_posix_path(const char *win,char *unx);
extern void cygwin_conv_to_full_win32_path(const char *unx,char *win);
#endif

char *helpdir = NULL;

#if __CygWin
/* Try to find the default browser by looking it up in the windows registry */
/* The registry is organized as a tree. We are interested in the subtree */
Expand Down Expand Up @@ -333,15 +331,8 @@ return;

if ( strstr(file,"http://")==NULL ) {
memset(fullspec,0,sizeof(fullspec));
if ( ! GFileIsAbsolute(file) ) {
printf("...helpdir:%p\n", helpdir );
if ( helpdir==NULL || *helpdir=='\0' ) {
snprintf(fullspec, PATH_MAX, "%s", getHelpDir());
} else {
printf("...helpdir2:%s\n", helpdir );
strncpy(fullspec,helpdir,sizeof fullspec - 1);
}
}
if ( ! GFileIsAbsolute(file) )
snprintf(fullspec, PATH_MAX, "%s", getHelpDir());
strcat(fullspec,file);
if (( pt = strrchr(fullspec,'#') )!=NULL ) *pt ='\0';
if ( !GFileReadable( fullspec )) {
Expand Down
16 changes: 0 additions & 16 deletions gtkui/prefs.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ extern int new_em_size; /* in splineutil2.c */
extern int new_fonts_are_order2; /* in splineutil2.c */
extern int loaded_fonts_same_as_new; /* in splineutil2.c */
extern int use_second_indic_scripts; /* in tottfgpos.c */
extern char *helpdir; /* in uiutil.c */
static char *othersubrsfile = NULL;
extern MacFeat *default_mac_feature_map, /* from macenc.c */
*user_mac_feature_map;
Expand Down Expand Up @@ -225,7 +224,6 @@ static struct prefs_list {
char *popup;
} general_list[] = {
{ N_("ResourceFile"), pr_file, &xdefs_filename, NULL, NULL, 'R', NULL, 0, N_("When FontForge starts up, it loads the user interface theme from\nthis file. Any changes will only take effect the next time you start FontForge.") },
{ N_("HelpDir"), pr_file, &helpdir, NULL, NULL, 'H', NULL, 0, N_("The directory on your local system in which FontForge will search for help\nfiles. If a file is not found there, then FontForge will look for it on the net.") },
{ N_("OtherSubrsFile"), pr_file, &othersubrsfile, NULL, NULL, 'O', NULL, 0, N_("If you wish to replace Adobe's OtherSubrs array (for Type1 fonts)\nwith an array of your own, set this to point to a file containing\na list of up to 14 PostScript subroutines. Each subroutine must\nbe preceded by a line starting with '%%%%' (any text before the\nfirst '%%%%' line will be treated as an initial copyright notice).\nThe first three subroutines are for flex hints, the next for hint\nsubstitution (this MUST be present), the 14th (or 13 as the\nnumbering actually starts with 0) is for counter hints.\nThe subroutines should not be enclosed in a [ ] pair.") },
{ N_("FreeTypeInFontView"), pr_bool, &use_freetype_to_rasterize_fv, NULL, NULL, 'O', NULL, 0, N_("Use the FreeType rasterizer (when available)\nto rasterize glyphs in the font view.\nThis generally results in better quality.") },
{ N_("SplashScreen"), pr_bool, &splash, NULL, NULL, 'S', NULL, 0, N_("Show splash screen on start-up") },
Expand Down Expand Up @@ -751,22 +749,8 @@ static void DefaultXUID(void) {
xuid = copy(buffer);
}

static void DefaultHelp(void) {
if ( helpdir==NULL ) {
#ifdef DOCDIR
helpdir = copy(DOCDIR "/");
#elif defined(SHAREDIR)
helpdir = copy(SHAREDIR "/doc/fontforge/");
#else
helpdir = copy("/usr/local/share/doc/fontforge/");
#endif
}
}

static void PrefsUI_SetDefaults(void) {

DefaultXUID();
DefaultHelp();
local_encoding = DefaultEncoding();
}

Expand Down
16 changes: 2 additions & 14 deletions gtkui/uiutil.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ extern void cygwin_conv_to_full_posix_path(const char *win,char *unx);
extern void cygwin_conv_to_full_win32_path(const char *unx,char *win);
#endif

char *helpdir = NULL;

#if __CygWin
/* Try to find the default browser by looking it up in the windows registry */
/* The registry is organized as a tree. We are interested in the subtree */
Expand Down Expand Up @@ -261,18 +259,8 @@ return;

if ( strstr(file,"http://")==NULL ) {
fullspec[0] = 0;
if ( *file!='/' ) {
if ( helpdir==NULL || *helpdir=='\0' ) {
#ifdef DOCDIR
strcpy(fullspec,DOCDIR "/");
#elif defined(SHAREDIR)
strcpy(fullspec,SHAREDIR "/doc/fontforge/");
#else
strcpy(fullspec,"/usr/local/share/doc/fontforge/");
#endif
} else
strcpy(fullspec,helpdir);
}
if ( *file!='/' )
strcpy(fullspec,getHelpDir());
strcat(fullspec,file);
if (( pt = strrchr(fullspec,'#') )!=NULL ) *pt ='\0';
if ( !GFileReadable( fullspec )) {
Expand Down

0 comments on commit 43b52fa

Please sign in to comment.