Changing hyperlink color in I7

Someone asked on IF Answers how to change the style of hyperlinks to make them black instead of blue, and possibly remove the underline. I’m curious to know the answer too. In Glulx Text Effects, none of the styles seems to correspond to hyperlinks.

From GTE:

A glulx text style is a kind of value.
The glulx text styles are all-styles, normal-style, italic-style, fixed-letter-spacing-style, header-style, bold-style, alert-style, note-style, blockquote-style, input-style, special-style-1 and special-style-2.

From GTE documentation:

Chapter: Styles in Glulx

Unlike the Z-Machine, which allows arbitrary combinations of features (such as color and boldness) to be applied to text, Glulx requires the author to define and then use text styles.

There are eleven of these styles:

Table of styles
normal-style the style used for regular text
italic-style used for italic text (this is what the “[italic type]” phrase uses)
bold-style used for bold text (this is what the “[bold type]” phrase uses)
fixed-letter-spacing-style used for monospaced text (this is what the “[fixed letter spacing]” phrase uses)
alert-style used when printing an end of game message such as "*** You have died. ***"
blockquote-style used for printing box quotations
header-style used to print the title of the game
input-style used for the player’s own input
note-style used for messages such as "[Your score has increased by one point.]"
special-style-1 these two styles are not used by Inform, and you are free to use them for any purpose you want

Possibly relevant code in Flexible Windows:

To say link (N - a number):
	(- if ( glk_gestalt( gestalt_Hyperlinks, 0 ) ) { glk_set_hyperlink( {N} ); } -).

To say end link:
	(- if ( glk_gestalt( gestalt_Hyperlinks, 0 ) ) { glk_set_hyperlink( 0 ); } -).

In Flexible Windows (the latest version), hyperlinks are set like this:

The description of Field is “To the [link 1]north[end link] a wide field opens, while to the [link 2]south[end link] a narrow path winds into dark woods.”

Does anyone know how to adjust the link color?

Many interpreters turn hyperlinks blue-underlined by default, to make them distinct from other text. Some have an option on the player’s end to disable this but I don’t think it’s controllable from the story file itself.

To add to what Draconis just said, I checked WinGlulxe’s .cfg files, and unfortunately they don’t seem to include a way to customise hiperlinks.

I wonder whether that’s not just a relic from the time when hyperlinks weren’t possible, or just not widely used. In which case, maybe David Kinder could be told that there’s starting to be a demand for it, and it might be a good addition to the terp.

Allowing .cfg files to also customise hyperlinks, I mean.

Thanks for the info!

I wonder if this is something that could be added in the future? The ability to change the link color from the story file, I mean.

It seems like a natural fit for “text style”, doesn’t it? Again, it probably didn’t arise because there wasn’t a need for it. It may be worth filing a bug/feature request in for I7 to allow it.

I’m pushing for this because, hey, if we don’t ask for it, it’s never going to happen anyway, so there’s nothing to lose, right? :wink:

I’m not sure where a request like that would go (for the story file, I mean, rather than the interpreter). Glulx Text Effects at Github?

(I mean, I know there’s the mantis site, but that’s for actual bugs, right?)

Zarf’s talked about overhauling the Glk style system for a while, and if that ever happens this would probably fit into that.

Well, the issue was closed on Github, so either that’s a “no” or it wasn’t clear what exactly I meant (i.e. the ability for story files to change this…regardless of whether that would be considered a feature request for Glk, or Glulx, or an extension, or whatever. It wasn’t necessarily tied to GTE, I just wasn’t sure where to put it). Not that it’s a priority for me or anything…

Is this merely a huge coincidence?

EDIT - Hey, turns out Gargoyle does allow you to set hyperlink colour.

linkcolor 000060 # hyperlink color

If you distribute your game with the Gargoyle Frotz terp and a cfg file, you’re set.

…accourse, this nowhere near as handy as defining it as part of the story file. But hey. Progress.

I’m not really sure what prompted the question on intfiction. (Or IFAnswers, for that matter.) I don’t know whether the two are related.