diff --git a/graphics/cph/help.gif b/graphics/cph/help.gif deleted file mode 100644 index b7e28ac3..00000000 Binary files a/graphics/cph/help.gif and /dev/null differ diff --git a/graphics/cph/readme.txt b/graphics/cph/readme.txt deleted file mode 100644 index bc2b9899..00000000 --- a/graphics/cph/readme.txt +++ /dev/null @@ -1,5 +0,0 @@ -for graphics/ - screen for HELP and HELP1 . Based on the INTERPIC and the HUD -font already in freedoom. - --- -cph@cph.demon.co.uk diff --git a/graphics/help.gif b/graphics/help.gif index f3ce0590..29a35b93 120000 --- a/graphics/help.gif +++ b/graphics/help.gif @@ -1 +1 @@ -cph/help.gif \ No newline at end of file +text/help.gif \ No newline at end of file diff --git a/graphics/text/.gitignore b/graphics/text/.gitignore index 7874fb6a..b93d8485 100644 --- a/graphics/text/.gitignore +++ b/graphics/text/.gitignore @@ -3,5 +3,6 @@ wi*.gif wilv*.gif cwilv*.gif dmwilv*.gif +help*.gif prboom.gif graphics.stamp diff --git a/graphics/text/Makefile b/graphics/text/Makefile index 8352c17b..c36fc27d 100644 --- a/graphics/text/Makefile +++ b/graphics/text/Makefile @@ -1,4 +1,4 @@ -GRAPHICS = \ +TEXTGEN_GRAPHICS = \ m_detail.gif m_disopt.gif m_disp.gif m_endgam.gif m_epi1.gif \ m_epi2.gif m_epi3.gif m_epi4.gif m_episod.gif m_gdhigh.gif \ m_gdlow.gif m_hurt.gif m_jkill.gif m_lgttl.gif m_loadg.gif \ @@ -13,7 +13,7 @@ GRAPHICS = \ m_mess.gif m_mouse.gif m_multi.gif m_player.gif m_serial.gif \ m_setup.gif m_sound.gif m_stat.gif m_status.gif m_tcpip.gif \ m_versen.gif m_video.gif m_wad.gif m_wadopt.gif m_weap.gif \ - prboom.gif \ + prboom.gif helpttl.gif \ m_ultra.gif wibp1.gif wibp2.gif wibp3.gif wibp4.gif \ wicolon.gif wienter.gif wif.gif wifrgs.gif wipcnt.gif \ wiminus.gif wimstar.gif wimstt.gif wiostf.gif wiosti.gif \ @@ -37,13 +37,13 @@ GRAPHICS = \ wilv33.gif wilv34.gif wilv35.gif wilv36.gif wilv37.gif \ wilv38.gif -all: $(GRAPHICS) +all: $(TEXTGEN_GRAPHICS) help.gif # textgen creates multiple outputs, which is awkward to express in # make. Use a witness file (graphics.stamp) as suggested in the # automake manual: "Handling Tools that Produce Many Outputs" -$(GRAPHICS): graphics.stamp +$(TEXTGEN_GRAPHICS): graphics.stamp @if test -f $@; then :; else \ rm -f graphics.stamp; \ $(MAKE) data.stamp; \ @@ -55,5 +55,14 @@ graphics.stamp: config.py fontchars ../../lumps/fraggle/freedoom.bex ./textgen @mv graphics.tmp $@ +help.gif: helpbg.gif helptext.gif helpttl.gif + convert helpbg.gif \ + -draw 'image over 0,0 0,0 helptext.gif' \ + -draw 'image over 140,5 0,0 helpttl.gif' \ + help.gif + +helpbg.gif: ../interpic.gif + convert ../interpic.gif -fill '#0077ff' -tint 50 helpbg.gif + clean: - rm -f $(GRAPHICS) graphics.stamp *.pyc + rm -f $(TEXTGEN_GRAPHICS) helpbg.gif help.gif graphics.stamp *.pyc diff --git a/graphics/text/config.py b/graphics/text/config.py index 824b0fde..2c7ddfc9 100644 --- a/graphics/text/config.py +++ b/graphics/text/config.py @@ -210,6 +210,12 @@ red_graphics = { 'm_multi': 'Multiplayer', } +# Rendered with transparent background: +transparent_graphics = { + # Title for the HELP/HELP1 screen: + 'helpttl': 'Help', +} + def read_bex_lump(filename): """Read the BEX (Dehacked) lump from the given filename. diff --git a/graphics/text/helptext.gif b/graphics/text/helptext.gif new file mode 100644 index 00000000..3a64709a Binary files /dev/null and b/graphics/text/helptext.gif differ diff --git a/graphics/text/textgen b/graphics/text/textgen index e2794d7e..bfa67550 100755 --- a/graphics/text/textgen +++ b/graphics/text/textgen @@ -208,20 +208,6 @@ class Font(object): return command_line - def render_transparent_text(self, text, output_filename, color): - """Render the given text to the given output file. - - The rendered text is generated with a transparent background. - """ - - if UPPERCASE_FONT: - text = text.upper() - command_line = self._make_command_line(text, color) - - command_line.append(output_filename) - - invoke_command(command_line) - def render_text(self, text, output_filename, color=COLOR_WHITE, bgcolor=BACKGROUND_COLOR): """Render text to a file with the given background color.""" @@ -230,16 +216,19 @@ class Font(object): text = text.upper() command_line = self._make_command_line(text, color) - command_line.extend([ - '-background', bgcolor, '-flatten', - output_filename]) + if bgcolor is not None: + command_line.extend([ + '-background', bgcolor, '-flatten']) + + command_line.append(output_filename) invoke_command(command_line) -def generate_graphics(graphics, color=COLOR_WHITE): +def generate_graphics(graphics, color=COLOR_WHITE, bgcolor=BACKGROUND_COLOR): for name, text in sorted(graphics.items()): print("# %s.gif: '%s'" % (name, text)) - font.render_text(text, '%s.gif' % name, color=color) + font.render_text(text, '%s.gif' % name, + color=color, bgcolor=bgcolor) def generate_kerning_test(): pairs = [] @@ -257,7 +246,8 @@ font = Font('fontchars', kerning_table=FONT_KERNING_RULES) # Enable to generate test image file for tweaking kerning values: #generate_kerning_test() -generate_graphics(red_graphics, COLOR_RED) -generate_graphics(blue_graphics, COLOR_BLUE) -generate_graphics(white_graphics, COLOR_WHITE) +generate_graphics(red_graphics, color=COLOR_RED) +generate_graphics(blue_graphics, color=COLOR_BLUE) +generate_graphics(white_graphics, color=COLOR_WHITE) +generate_graphics(transparent_graphics, color=COLOR_RED, bgcolor=None)