Author Topic: libjcsi patch  (Read 7634 times)

XLambda

  • Rogueliker
  • ***
  • Posts: 208
  • Karma: +0/-0
    • MSN Messenger - tau_iota@live.de
    • View Profile
    • The Weird Rogue
libjcsi patch
« on: June 16, 2012, 01:02:42 PM »
I recently went through the libjcsi code and fixed a few bugs.

Changelog:
- background colors will now be buffered correctly when using the Swing interface
- Symbols are now directly adjacent to each other vertically, which allows the use of box-drawing characters.
- the window height is now correctly derived from the console and font dimensions.

I post the patch here so Slash can add it to the repo. :)

EDIT: Apparently the forum does not allow me to attach the patchfile, so here it goes. Patch.
« Last Edit: June 16, 2012, 01:04:24 PM by XLambda »

Krenium

  • Newcomer
  • Posts: 14
  • Karma: +0/-0
    • View Profile
Re: libjcsi patch
« Reply #1 on: June 17, 2012, 01:16:43 AM »
Wow! I wrote a routine using libjcsi to draw textboxes using box-drawing unicode characters less than 12 hours ago and I was puzzling over this. Horizontal lines were fine but the vertical ones were broken up. This is wonderful! Thanks!  ;D

I do have a question, though. There seems to be a good chunk of 'unused' space resulting in a moderate-sized gap between WSwingConsoleInterface.xdim and the right edge of the window. There's also a small one between ydim and the bottom of the window. Is there any way to get rid of that? Or is that what the third fix is?

Oh, I have another question: can libjcsi do multi-key input? I want to detect when ctrl + [letter] is pressed, but I can't seem to figure out how.
« Last Edit: June 17, 2012, 02:01:53 AM by Krenium »

XLambda

  • Rogueliker
  • ***
  • Posts: 208
  • Karma: +0/-0
    • MSN Messenger - tau_iota@live.de
    • View Profile
    • The Weird Rogue
Re: libjcsi patch
« Reply #2 on: June 17, 2012, 10:38:41 AM »
Wow! I wrote a routine using libjcsi to draw textboxes using box-drawing unicode characters less than 12 hours ago and I was puzzling over this. Horizontal lines were fine but the vertical ones were broken up. This is wonderful! Thanks!  ;D

I do have a question, though. There seems to be a good chunk of 'unused' space resulting in a moderate-sized gap between WSwingConsoleInterface.xdim and the right edge of the window. There's also a small one between ydim and the bottom of the window. Is there any way to get rid of that? Or is that what the third fix is?

Oh, I have another question: can libjcsi do multi-key input? I want to detect when ctrl + [letter] is pressed, but I can't seem to figure out how.

Hey there,

good to hear that! There are still some problems with small sizes and some fonts - due to hinting, I believe - but it should work for most of them. fontMetrics (which libjcsi uses) isn't entirely accurate. I'm still looking for ways to work around that.

The unused space is directly related to the font problem, since fontMetrics is used to calculate window size. Again, the patch should eliminate most of the unused space, but with some fonts, there might still be problems.

Libjcsi doesn't support multi-key input, but it's not hard to do on your own, using awt. Just have a look around the internet, or make an extra thread for that here in the Dev section.

Slash

  • Creator of Roguetemple
  • Administrator
  • Rogueliker
  • *****
  • Posts: 1203
  • Karma: +4/-1
    • View Profile
    • Slashie.net
    • Email
Re: libjcsi patch
« Reply #3 on: June 29, 2012, 05:15:20 PM »
Hi XLambda?

What revision did you apply the changes into? I'm trying to apply the patch to the latest version but it doesn't seem to be compatible; did you bring back the "backColors" buffer by choice?

Slash

  • Creator of Roguetemple
  • Administrator
  • Rogueliker
  • *****
  • Posts: 1203
  • Karma: +4/-1
    • View Profile
    • Slashie.net
    • Email
Re: libjcsi patch
« Reply #4 on: June 29, 2012, 05:20:03 PM »
Nevermind, I've applied the patch and commit to the latest rev, thanks!