#===============================================================================
# Gargoyle Glk configuration
#-------------------------------------------------------------------------------
#
# Gargoyle will look for configuration files and load them in this
# order, with later settings overriding earlier settings:
#
#   1: same directory as the executable: garglk.ini (windows)
#   2: /etc/garglk.ini (or other location set at build time, Unix only)
#   3: Platform-specific locations:
#          $HOME/.garglkrc (unix)
#          ${XDG_CONFIG_HOME:-$HOME/.config}/garglk.ini (unix)
#          <user settings directory>/Gargoyle (haiku)
#          %APPDATA%/Gargoyle/garglk.ini (windows)
#          current working directory: garglk.ini (windows)
#          $HOME/garglk.ini (mac)
#   4: game directory: garglk.ini
#   5: name-of-game-file.ini (so for hell.gam it would read hell.ini)
#
# Sections of the config file can be turned on or off by matching
# either the interpreter or game file being run. See the bottom
# of this file for examples.

# In addition to a user's specific config file, games can provide their
# own config file to overwrite some or all of a user's settings. This
# can be disabled by setting the following option to 0.
game_config   1

scrollwidth   0               # set to 8 to make a nice scrollbar
scrollbg      b0b0b0
scrollfg      808080

# By default, games/interpreters are allowed to change the appearance of
# Gargoyle to some degree: colors can be set, reverse video can be set, and the
# appearance of Glk styles can be changed (allowing interpreters to change what
# the style "emphasized" means, for example). Setting this to 0 disables this
# behavior: colors can't be used, reverse video can't be used, and stylehint
# settings are ignored. The impetus for this option was to allow users to
# disable games whose colors they found distasteful.
stylehint     1

safeclicks    1               # set to 0 if game cancels line events properly

cols          60              # nice good line length for reading. but...
rows          25              # see the bottom for terp-specific over-rides

lockcols      0               # set to 1 to enforce col count
lockrows      0               # set to 1 to enforce row count

# Gargoyle can try to restore the last window size and window location.
# This is generally only provided as a hint to the window system, and
# may be ignored. The value is whitespace-delimited strings taking the
# value "size" or "location":
#
# save_window size
# save_window location
# save_window size location
#
# The default is to save neither. If Gargoyle is able to restore a
# saved window size, then the "cols" and "rows" settings are ignored.
#
# If either of these is true, then the fullscreen state will be stored
# as well.

justify       0               # 0=ragged-right 1=justified
quotes        1               # Smart quotes           -- 0=off 1=normal 2=rabid
dashes        1               # Dash replacement level -- 0=off 1=-,em 2=-,en,em
spaces        1               # Spaces after full stop -- 0=off 1=one 2=two
caps          0               # Force uppercase input  -- 0=off 1=on

graphics      1               # enable graphics
sound         1               # enable sound

# Gargoyle supports MIDI files, as used by some Adrift games. Unlike other
# supported file formats, MIDI files require external instruments, so can
# require a bit more effort to get working. If the SDL sound backend is
# enabled, it's possible that native operating system routines are being used
# on Windows, Mac, and Haiku. For the Qt backend, or the SDL backend on other
# platforms, SoundFonts are used to provide the instruments. Here you can
# specify which SoundFonts you want to use, with higher priority ones listed
# first: if an instrument is not found in the first font, the second is
# consulted, and so on.
#
# soundfont "/soundfont1.sf2" "/soundfont2.sf2"

# If FluidSynth is being used for MIDI playback (which is the case if the Qt
# sound backend is enabled), its reverb and chorus effects can be disabled by
# setting the corresponding option to 0 (false).
#
# fluidsynth_reverb 1
# fluidsynth_chorus 1

# Gargoyle provides support for the Z-Machine's sound effects 1 and 2.
# The Z-Machine Standards Document 1.1 says this about so-called bleeps:
#
# "Number 1 is a high-pitched bleep, number 2 a low-pitched one"
#
# Here you can define what the bleeps sound like. The syntax is this:
#
# zbleep number duration frequency
#
# number is either 1 or 2
# duration is the duration, in seconds, and can be fractional
# frequency is the pitch in Hz (440 = A5), and must be integral
#
# This creates a pure (sinusoidal) tone at the given frequency.
#
# To disable a bleep, set its duration to 0. The defaults here mimic
# Infocom's DOS interpreter. To mimic Infocom's C128 interpreter:
#
# zbleep        1 0.1 1480
# zbleep        2 0.1 660
#
# Instead of a generated tone, you can provide a file to be used as the
# bleep. This has the syntax:
#
# zbleep_file   1 /path/to/file.aiff
# zbleep_file   2 /path/to/file.aiff
#
# The file should be a Blorb-supported file (AIFF or Ogg Vorbis),
# although Gargoyle also currently supports, as extensions to Blorb, WAV
# and MP3 files.
zbleep        1 0.1 1175
zbleep        2 0.1 440

fullscreen    0               # set to 1 for fullscreen
zoom          1.0             # set display zoom

# Normally Gargoyle scales images using a simple algorithm which does
# not do any interpolation/smoothing. In general this is fine, but for
# older pixel art games (namely Infocom's version 6 games), scaling up
# results in very blocky images. If you would prefer smoother images,
# Gargoyle provides two pixel art scalers:
#
# • hqx (see https://en.wikipedia.org/wiki/Pixel-art_scaling_algorithms#hqnx_family)
# • xBRZ (see https://en.wikipedia.org/wiki/Pixel-art_scaling_algorithms#xBR_family)
#
# To use these, set the "scaler" option to "hqx" or "xbrz". Setting it
# to "none", or not providing this option at all, will use the normal
# resizing algorithm. Note that these scalers always scale by an integer
# multiple, e.g. a 320x200 image can be scaled to 640x400, but not
# 480x300. To work around this, Gargoyle will first use the provided
# scaler to scale up to the nearest multiple that is larger than the
# target size, and then use the normal scaler to reduce the image to the
# requested size.
#
# The scalers are likely to only be useful with Infocom's games, and may
# cause unwanted graphics glitches in newer games. Due to this, it's
# recommended to limit the scaler to the Bocfel interpreter below in the
# "override" section, e.g.:
#
# [bocfel]
# scaler xbrz
scaler none

# If set to 1, Gargoyle will wait for a keypress when a game quits, to
# allow text printed just before quitting to be seen. If you would
# rather that Gargoyle quit immediately, set this to 0.
wait_on_quit 1

# By default, Gargoyle will allow the native file picker (Qt or MacOS)
# to choose which directory to open in when saving and loading files,
# including save games, transcripts, and generic data files. This may
# not be the most desirable location. You can instead choose to save
# either in a centralized save directory or the directory containing the
# currently-running game.
#
# If a centralized location is requested, a dedicated directory for each
# game is created. This will be something like:
#
# $HOME/.local/share/gargoyle/gamedata/zork1.z3/ (Unix)
# %APPDATA%\Gargoyle\gamedata\zork1.z3\ (Windows)
# $HOME/Library/Application Support/Gargoyle/gamedata/zork1.z3/ (Mac)
#
# To use the default, set this to "default". For a dedicated centralized
# location, use "dedicated". For the game's containing directory, use
# "gamedir".
gamedata_location default

#===============================================================================
# Fonts, sizes and spaces
# (Tweak this if you choose other fonts, or want bigger text)
#-------------------------------------------------------------------------------
#
# The 'standard' fonts.
# Omit to use the builtin fonts, or specify a font family.

monofont      Gargoyle Mono
monosize      12.6

propfont      Gargoyle Serif
propsize      14.7

wmarginx      20              # space around the window frame
wmarginy      20
wpaddingx     0               # space between windows
wpaddingy     0
wborderx      0               # border line width between windows
wbordery      0
tmarginx      7               # internal margin of text windows
tmarginy      7

leading       20              # Also known as linespacing
baseline      15              # Offset from top of line to baseline

# Fonts for Text Buffer windows
tfont  0      propr           # Normal
tfont  1      propi           # Emphasized
tfont  2      monor           # Preformatted
tfont  3      propb           # Header
tfont  4      propb           # Subheader
tfont  5      propz           # Alert
tfont  6      propi           # Note
tfont  7      propr           # BlockQuote
tfont  8      propb           # Input
tfont  9      propr           # User1
tfont 10      propr           # User2

# Fonts for Text Grid windows
gfont  0      monor           # Normal
gfont  1      monoi           # Emphasized
gfont  2      monor           # Preformatted
gfont  3      monob           # Header
gfont  4      monob           # Subheader
gfont  5      monoz           # Alert
gfont  6      monoi           # Note
gfont  7      monor           # BlockQuote
gfont  8      monob           # Input
gfont  9      monor           # User1
gfont 10      monor           # User2

# Fonts have gaps in their coverage of characters. Historically when your
# preferred font didn't support a particular character, Gargoyle rendered it as
# a question mark. Now GNU Unifont is included, and used as a fallback for
# glyphs that don't exist in the primary font. Unifont has complete coverage of
# the Basic Multilingual Plane and wide coverage of the Supplementary
# Multilingual Plane. However, it is a rather utilitarian font, so if you'd
# like to use different fonts as fallbacks, you can do so here. You can specify
# as many fallback fonts as you want, with the higher priority ones listed
# first. Unifont will still be used as a last resort.
#
# Unifont will substitute for both proportional and monospace fonts, but if you
# provide your own proportional substitute font, it will not look good in
# monospace. Therefore, when you supply your own fallback fonts, you can specify
# whether they are proportional, monospace, or both.
#
# You can specify as many fonts as you want, separated by space. First-listed
# fonts have higher priority.
#
# Font paths must be absolute: the behavior of relative paths is unspecified.
# Fonts can be OpenType, TrueType, or Type 1.
#
# The syntax is:
#
# glyph_substitution_file style /path/to/font [/path_to_font...]
#
# Where "style" is:
# • monor, monob, monoi, monoz, propr, propb, propi, propz
#   (monospace/proportional regular, bold, italic, bold italic)
# • mono (all monospace styles)
# • prop (all proportional styles)
# • * (both monospace and proportional styles)
#
# Gargoyle will generate, as necessary, bold and italic styles, so if there's a
# font you like, but it only has, for example, regular and bold variants:
#
# glyph_substitution_file propb /fonts/Bold.ttf
# glyph_substitution_file propz /fonts/Bold.ttf
# glyph_substitution_file prop /fonts/Regular.ttf
#
# Or if a font only has regular:
#
# glyph_substitution_file prop /fonts/Regular.ttf
#
# Remember that the first-listed font has higher priority, so list more specific
# fonts first (e.g. propr before prop, and prop before *).

#===============================================================================
# Text LCD Filtering
#-------------------------------------------------------------------------------
#
# When using LCD subpixel rendering, the filter used (if not set otherwise) will
# be equivalent to the filter Gargoyle has always used. This looks fairly good
# without gamma correction, but might be blurrier than some people prefer.
#
# The available values for lcdfilter are:
#
#   1: none (equiv. custom filter: 0 0 255 0 0)
#      This filter looks very ugly and is not recommended. However, it is the
#      absolute sharpest, and when used with the correct gamma value on a high-
#      DPI display, can give the clearest and sharpest possible text.
#
#   2: default (equiv. custom filter: 8, 77, 86, 77, 8)
#      This is not the default filter for Gargoyle, but it is FreeType's default
#      filter for LCD rendering. It's similar to Gargoyle's, but a tad sharper,
#      and is color balanced (the values for the filter add up to 256), unlike
#      Gargoyle's filter (which add up to less than - but close to - 256, which
#      can sometimes lead to slightly pale colors when using gamma correction).
#
#   3: light (equiv. custom filter: 0 85 86 85 0)
#      This filter is color-balanced like the default one, but is as sharp as
#      possible while also attempting to eliminate color fringes caused by the
#      use of subpixel rendering. However, while using 'default' will also help
#      eliminate such color fringes while not using gamma correction (by setting
#      gamma to 1.0), this 'light' filter is less forgiving. Using 'light' is
#      generally recommended most when using the appropriate gamma correction
#      for your display.
#
#   4: legacy (no equiv. custom filter; uses different algorithm)
#      This filter is similar to 'none', but with its effect significantly toned
#      down. The result is a very sharp filter that might not be TOO noticeable.
#      However, it was designed for fully hinted text that's been snapped to the
#      pixel grid of the display, and causes severe color fringes otherwise.
#      Since Gargoyle does not use font hinting, the color fringes caused by
#      this filter can be just as noticeable as the ones caused by 'none'.
#
# If any other value is set, the custom filter is used. If one is not set, the
# custom filter will use values equivalent to how Gargoyle has filtered subpixel
# text in the past. By default, Gargoyle does not use gamma correction.
#
# When using gamma correction and LCD subpixel font rendering, it's recommended
# to set lcdfilter to either 'default' or 'light'.
#
# If you choose your own filter, it's recommended to follow the advice at the
# top of the following FreeType documentation page:
# https://www.freetype.org/freetype2/docs/reference/ft2-lcd_rendering.html

lcd           1               # 0=grayscale 1=subpixel
lcdfilter     custom          # subpixel filter, set to 'default' if blurry
lcdweights    28 56 85 56 28  # custom filter, default is Gargoyle's own


#===============================================================================
# Colors and style definitions
#-------------------------------------------------------------------------------
#
# Default here is for black text on a white background.
#
# Depending on your screen you may want to tweak the gamma.
# Good values to try are 1.0, 1.8 and 2.2.
#
# There are separate colors for TextBuffer and TextGrid windows.
# TextBuffers are main text windows, TextGrids are used mainly for
# status bars and such.

gamma         1.0             # this affects text rendering, not other colors

caretshape    2               # 0=smalldot 1=fatdot 2=thinline 3=fatline 4=block
linkstyle     1               # 1=underline hyperlinks 0=don't underline hyperlinks

# moreprompt  ( more )
# morealign   0               # 0=left 1=center 2=right
# morefont    propb

windowcolor   ffffff          # overall window background color
bordercolor   000000          # border line color
caretcolor    000000          # input caret color
linkcolor     000060          # hyperlink color
morecolor     006000          # more prompt color

# Colors for text buffer windows
tcolor  0     000000  ffffff  # Normal
tcolor  1     000000  ffffff  # Emphasized
tcolor  2     000000  ffffff  # Preformatted
tcolor  3     000000  ffffff  # Header
tcolor  4     000000  ffffff  # Subheader
tcolor  5     000000  ffffff  # Alert
tcolor  6     000000  ffffff  # Note
tcolor  7     000000  ffffff  # BlockQuote
tcolor  8     006000  ffffff  # Input
tcolor  9     000000  ffffff  # User1
tcolor 10     000000  ffffff  # User2

# Colors for text grid windows
gcolor  0     606060  ffffff  # Normal
gcolor  1     606060  ffffff  # Emphasized
gcolor  2     606060  ffffff  # Preformatted
gcolor  3     606060  ffffff  # Header
gcolor  4     606060  ffffff  # Subheader
gcolor  5     606060  ffffff  # Alert
gcolor  6     606060  ffffff  # Note
gcolor  7     606060  ffffff  # BlockQuote
gcolor  8     606060  ffffff  # Input
gcolor  9     606060  ffffff  # User1
gcolor 10     606060  ffffff  # User2

# Instead of needing to specify individual colors, Gargoyle supports the concept
# of color themes, which set all possible colors at once. There are two
# hard-coded themes: "light" and "dark". In addition, there is a pseudo theme
# called "system" which attempts to follow the system theme, setting a dark or
# light theme as appropriate.
# Gargoyle also comes with several other themes, and you can provide your own
# themes as well. To see a list of available themes, use Shift-Control-T while
# Gargoyle is running. To see a list of theme paths (where you can add your own
# themes), use Control-period. MacOS users substitute Command for Control.
# This must come after all other color settings, or they will override the theme.
# See THEMES.md for information on how themes are created.
theme system

#===============================================================================
# Text-to-speech (TTS)
#-------------------------------------------------------------------------------
#
# Gargoyle can be built with text-to-speech capability. If so, the
# following options control it.

speak            0           # 1=enable TTS, 0=disable TTS

# The following apply only if TTS is enabled.
# speak_input    0           # 1=speak input the player types, 0=don't speak input

# speak_language en          # if supported by the TTS engine, the language used
                             # for synthesis, as described by RFC 1766. Currently
                             # supported on OS X, and Unix with speech-dispatcher.


#===============================================================================
# You can add sections here to over-ride settings. List all the executables to
# be affected in the [ selector list ]. The name of game file can also be used
#-------------------------------------------------------------------------------

[ trinity.z4 ]
mincols       62              # Trinity requires at least 62 columns

[ winter.z5 ]
mincols       78
minrows       26              # Winter Wonderland contains ASCII art


#===============================================================================
# You can specify the default interpreter for game types. List all extensions to
# be affected in the [ selector list ]. The name of a game file can also be used
#-------------------------------------------------------------------------------

# Zcode game types
# [ *.z3 *.z4 *.z5 *.z6 *.z7 *.z8 *.zlb *.zblorb ]
# terp bocfel

# Glulx game types
# [ *.ulx *.blorb *.glb *.gblorb ]
# terp git

# Superglus games require Glulxe
# [ *.blb ]
# terp glulxe

# Override for specific game
# [ Floatpoint.zblorb ]
# terp glulxe

# Gargoyle's Magnetic Scrolls interpreter has several graphics-related
# extensions, selected by passing options to the interpreter.
#
# -sc: Integral value by which images are scaled. Defaults to 2. Can take any
#      value from 1 to 8.
# -gp: Integral value specifying the percentage of vertical space taken up by
#      the graphics window. Defaults to 60 (so the top 60% of the window is
#      dedicated to images). Can take any value from 1 to 100.
# -gx: Integral value specifying the absolute height of the graphics window in
#      pixels. If specified, takes precedence over -gp. Can take any positive
#      value.
#
# [ *.mag ]
# terp magnetic -sc 3 -gp 40


#===============================================================================
# ADRIFT 5 conventionally present colored text on a dark background (because
# that is the system's default, and the majority of games lean into it). Conform
# to this convention to ensure that hyperlinks don't go invisible, and to remove
# annyoing light borders.
#-------------------------------------------------------------------------------
[ FrankenDrift.GlkRunner FrankenDrift.GlkRunner.Gargoyle ]
theme dark
