Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

[open] Font size is smaller when experiment is run

edited January 2015 in OpenSesame

I use a sketchpad to display a background image and some textual descriptions on top of it. It all looks nice in the development window, but once I actually run the experiment, all the text is smaller. The text fields appear at the correct location, but do not extend to same place to the right and to the bottom as they should. Is there a way to fix this issue?

I'm on Ubuntu 14.10, using the DejaVu Sans font (I need special characters from it) with the Expyriment back-end since I definitely care about millisecond precision. I tried changing the back-ends just to see if this issue will go away, but I couldn't run any of the other back-ends. The PsychoPy back-end showed an error associated with audio and Legacy could not find the DejaVu Sans.ttf file. In any case, I'd like to resolve the issue and stick to Expyriment.

Any hints are much appreciated.

Comments

  • edited 8:56AM

    Hi,

    This is indeed a small bug: In the GUI the font size is specified in points, but during the experiment it is specified in pixels, as it should be.

    This is just a visual glitch, so you can safely ignore the fact that the GUI shows the font to be slightly larger (on most systems) than it should be.

    Legacy could not find the DejaVu Sans.ttf file

    Could you provide some more info? What exactly did you do, and where did you place the font file?

    Cheers,
    Sebastiaan

  • edited 8:56AM

    Hi Sebastiaan

    Thanks for looking into this.

    Do you know if you'll be releasing a fix for this bug with the next maintenance release and if so when might that be? In my particular case, I need to carefully position some text and visual elements with respect to each other. It's quite hard to do so as I have to run the experiment over and over again just to see if things are at the right place, so I would really appreciate the ability to this in the GUI.

    I haven't really done anything special for the fonts. The font file is in the default location in Ubuntu (/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf). I just selected "DejaVu Sans" in the general properties of my experiment, and it worked without a hitch with Expyriment. If I change the back-end to legacy in the general properties tab, I get this error message:

    Unexpected error
    line: 423
    exception message: The resource 'DejaVu Sans.ttf' could not be found in libopensesame.experiment.resource()
    exception type: Exception
    
    Traceback (also in debug window):
      File "/usr/lib/pymodules/python2.7/libqtopensesame/misc/process.py", line 139, in run
        exp.run()
      File "/usr/lib/pymodules/python2.7/libopensesame/experiment.py", line 335, in run
        self.init_display()
      File "/usr/lib/pymodules/python2.7/libopensesame/experiment.py", line 690, in init_display
        canvas.init_display(self)
      File "/usr/lib/pymodules/python2.7/openexp/canvas.py", line 66, in init_display
        mod.init_display(experiment)
      File "/usr/lib/pymodules/python2.7/openexp/_canvas/legacy.py", line 317, in init_display
        u"%s.ttf" % experiment.font_family), experiment.font_size)
      File "/usr/lib/pymodules/python2.7/libopensesame/experiment.py", line 423, in resource
        % name)
    Exception: The resource 'DejaVu Sans.ttf' could not be found in libopensesame.experiment.resource()
    

    It seems like OpenSesame is trying to use the wrong file name (has an extra space). Is there something special that needs to be done before that font works with Legacy? In any case, as I mentioned I don't really want to use Legacy, but I'm willing to help diagnose this problem if you wish.

    Cheers,
    Mitko

  • edited 8:56AM

    Thanks for the error message. That does indeed look like another font-related bug.

    I will include these fixes in 2.9.3, which I'll probably release somewhere in the next few weeks. These are actually the first new bugs that have been reported, and I generally wait until there's a bit more before building a new release. If you want to fix the size issue before then, you consider grabbing the latest snapshot from GitHub (the heisenberg branch). Even just replacing your libqtopensesame/misc/sketchpad_canvas.pyc with the updated file should do the trick:

    Cheers!
    Sebastiaan

  • edited 8:56AM

    Hi Sebastiaan,

    Thank you very much for the suggested fix. I replaced the python files and now the disparity between the GUI and the running experiment is greatly reduced. The current state is sufficient for my needs. :)

    In case you want to dig deeper into this to achieve a perfect match between the sketchpad GUI and the rendering during a run, have a look at this image to see the differences that I am currently seeing:

    The part on the top is the GUI and the one on the bottom is the running experiment in a window (running in a full screen has the same issue).

    The little red lines are sketchpad arrows and as you can see, they are identically positioned in both cases. Relative to them, the text position/size does not quite match. I hope this helps.

    Thanks for your support.

    Cheers,
    Mitko

  • edited 8:56AM

    Hi Mitko,

    The GUI uses a different font engine than the back-ends, each of which in turn renders text slightly differently. I just tried it with a few different fonts, and, indeed, for some reason Deja Vu Sans is rendered much narrower during the experiment than in the GUI. Much more so than other fonts, which is weird. But as far as I can tell, it's a genuine difference between the font engines.

    Cheers,
    Sebastiaan

Sign In or Register to comment.

agen judi bola , sportbook, casino, togel, number game, singapore, tangkas, basket, slot, poker, dominoqq, agen bola. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 50.000 ,- bonus cashback hingga 10% , diskon togel hingga 66% bisa bermain di android dan IOS kapanpun dan dimana pun. poker , bandarq , aduq, domino qq , dominobet. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 10.000 ,- bonus turnover 0.5% dan bonus referral 20%. Bonus - bonus yang dihadirkan bisa terbilang cukup tinggi dan memuaskan, anda hanya perlu memasang pada situs yang memberikan bursa pasaran terbaik yaitu http://45.77.173.118/ Bola168. Situs penyedia segala jenis permainan poker online kini semakin banyak ditemukan di Internet, salah satunya TahunQQ merupakan situs Agen Judi Domino66 Dan BandarQ Terpercaya yang mampu memberikan banyak provit bagi bettornya. Permainan Yang Di Sediakan Dewi365 Juga sangat banyak Dan menarik dan Peluang untuk memenangkan Taruhan Judi online ini juga sangat mudah . Mainkan Segera Taruhan Sportbook anda bersama Agen Judi Bola Bersama Dewi365 Kemenangan Anda Berapa pun akan Terbayarkan. Tersedia 9 macam permainan seru yang bisa kamu mainkan hanya di dalam 1 ID saja. Permainan seru yang tersedia seperti Poker, Domino QQ Dan juga BandarQ Online. Semuanya tersedia lengkap hanya di ABGQQ. Situs ABGQQ sangat mudah dimenangkan, kamu juga akan mendapatkan mega bonus dan setiap pemain berhak mendapatkan cashback mingguan. ABGQQ juga telah diakui sebagai Bandar Domino Online yang menjamin sistem FAIR PLAY disetiap permainan yang bisa dimainkan dengan deposit minimal hanya Rp.25.000. DEWI365 adalah Bandar Judi Bola Terpercaya & resmi dan terpercaya di indonesia. Situs judi bola ini menyediakan fasilitas bagi anda untuk dapat bermain memainkan permainan judi bola. Didalam situs ini memiliki berbagai permainan taruhan bola terlengkap seperti Sbobet, yang membuat DEWI365 menjadi situs judi bola terbaik dan terpercaya di Indonesia. Tentunya sebagai situs yang bertugas sebagai Bandar Poker Online pastinya akan berusaha untuk menjaga semua informasi dan keamanan yang terdapat di POKERQQ13. Kotakqq adalah situs Judi Poker Online Terpercayayang menyediakan 9 jenis permainan sakong online, dominoqq, domino99, bandarq, bandar ceme, aduq, poker online, bandar poker, balak66, perang baccarat, dan capsa susun. Dengan minimal deposit withdraw 15.000 Anda sudah bisa memainkan semua permaina pkv games di situs kami. Jackpot besar,Win rate tinggi, Fair play, PKV Games