Author Topic: BearLibTerminal: a pseudo-terminal window library for roguelike  (Read 55122 times)

Nekoninja

  • Acolyte
  • *
  • Posts: 33
    • View Profile
Re: BearLibTerminal: a pseudo-terminal window library for roguelike
« Reply #255 on: February 14, 2018, 11:52:36 PM »
I was able to get the BearLibTerminal to work with Larazus. The BearLibTerminal.pas file need one small additional. Add this "{$mode objfpc}" in before {$H+} on line 22. After this, it works beautiful. Will test it with Free Pascal and Delphi 10.2 (32 bit only since I got it free). For some reason I cannot explain why, perhaps someone can, I had to use the 64 bits BearLibTerminal.dll.

Will keep it post of my research results.
Bow to me, your evil programmer or I will destroy the internet with my 'delete' button!

Zireael

  • Protector of the @
  • *****
  • Posts: 604
    • View Profile
Re: BearLibTerminal: a pseudo-terminal window library for roguelike
« Reply #256 on: February 17, 2018, 04:09:11 PM »
Quote from: The Saber Cat
Is there a way to use fonts of two different pixel sizes as ttf imports, without converting one of them in .png? If yes, how codepoints are shared between them?
Well it is indeed hard to guess what exactly do you have trouble with, but probably you're trying to put both fonts in a single codespace, i. e. make the them all have different code points similar to font + tiles. BearLibTerminal support multiple codespaces for this purpose exactly, to have two (or more) separate fonts, with each one using the same (yet their own) code points for the same characters/tiles:

Code: [Select]
terminal.set('font: one.ttf, size=8x16')
terminal.set('another font: two.ttf, size=10x20')

Would it be possible to load the same font twice (the default one shipped with BLT), but with one of them having the codepoints overriden by tiles and the other not? Or does it have to be two different .ttf files?

Where 'another' is an arbitrary name to your liking. And then there are two ways to use it:

Code: [Select]
# Inline string formatting
terminal.puts(2, 1, 'Hello, [font=another]World')

# Global state
terminal.puts(2, 2, 'Hello, ')
terminal.font('another')
terminal.puts(2+7, 2, 'World')