WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: opera: fixed window size and true type fonts  (Read 9519 times)

Offline nObRaIn

  • Newbie
  • *
  • Posts: 18
opera: fixed window size and true type fonts
« on: December 31, 2010, 09:42:46 AM »
I'm having this problem when I switch from a system with high resolution to another with lower maximum resolution(booting tc 3.4 from usb). Part of opera's window is off the screen and I can't find a way to move or resize it. Is it somehow possible to start opera with a fixed window size every time?

I'm also having trouble with true type fonts. i did try loading fontconfig with dejavu fonts but opera doesn't seem to be using them. I also tried copying some fonts in ~/.fonts but it didn't make any difference either. I guess i'm missing something very obvious here so any help is greatly appreciated.

btw, this is opera 9.64 that i'm using.

Offline roberts

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 7361
  • Founder Emeritus
Re: opera: fixed window size and true type fonts
« Reply #1 on: December 31, 2010, 10:32:44 AM »
For oversized windows, when using the default window manager, simply use
Ctrl-Alt-m or many of the other control alt keys as shown in:
http://distro.ibiblio.org/pub/linux/distributions/tinycorelinux/3.x/tcz/flwm_topside.tcz.info
10+ Years Contributing to Linux Open Source Projects.

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: opera: fixed window size and true type fonts
« Reply #2 on: December 31, 2010, 11:54:06 AM »
from 'opera -help':

-geometry <geometry>           set geometry of toplevel window
* <geometry> format is: WIDTHxHEIGHT+XOFF+YOFF

that eased the issue with flwm for me.

However, what roberts said is the approach to deal with it globally - as opposed to a per application based approach.
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline nObRaIn

  • Newbie
  • *
  • Posts: 18
Re: opera: fixed window size and true type fonts
« Reply #3 on: January 01, 2011, 09:33:21 PM »
Thank you both for the quick help. I did try googling for flwm's hotkeys before, but what I found was much different and mostly not working (alt+up, alt+down etc from older versions i guess).

Even though I will most likely not be needing this now, how would I set the geometry parameter permanently in opera's shortcut in wbar?

Also, any ideas about the fonts?

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: opera: fixed window size and true type fonts
« Reply #4 on: January 01, 2011, 10:12:45 PM »
Do the fonts you installed show up as a choice in fonts preferences of opera or not?
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline maro

  • Hero Member
  • *****
  • Posts: 1228
Re: opera: fixed window size and true type fonts
« Reply #5 on: January 01, 2011, 10:38:53 PM »
AFAIK Opera stores such settings in '~/.opera/opera6.ini'. That file contains a '[Windows]' section and in it a 'Browser Window=...' entry. This entry seems to contain: x-coordinate (of the top left corner), y-coordinate (of the top left corner), width, height, and state (0=normal, 1=minimized, 2=maximized). Both coordinates, the width and height are obviously given in pixels.


EDIT: I'm sorry, it seems to be another case where I've read the question posted only half ... Anyway to include the "-geometry WxH+x+y" paramter to the 'wbar' config one could use something like:
    sudo sed -i '/^c:.*\/opera /s#$# -geometry 700x500+50+50#' /usr/local/tce.icons && wbar.sh
Please note that the re-start of 'wbar' (via 'wbar.sh') is required for the change to be picked up.
« Last Edit: January 01, 2011, 11:00:19 PM by maro »

Offline nObRaIn

  • Newbie
  • *
  • Posts: 18
Re: opera: fixed window size and true type fonts
« Reply #6 on: January 02, 2011, 08:20:23 AM »
Do the fonts you installed show up as a choice in fonts preferences of opera or not?
I was expecting opera to recognize and use the new fonts without my intervention so I did't check the preferences at all. Right now I only have dejavu-fonts with fontconfig and expat2 installed and I don't see any new fonts in preferences.

sudo sed -i '/^c:.*\/opera /s#$# -geometry 700x500+50+50#' /usr/local/tce.icons && wbar.sh[/color]
Just to make sure I understand this correctly, this will add "-geometry 700x500+50+50" right after "/opera" in /usr/local/tce.icons and it will replace it if a -geometry switch is already in there?

Sorry for asking too many questions, I've been away from linux for quite some time and I'm trying to catch up a bit.

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: opera: fixed window size and true type fonts
« Reply #7 on: January 02, 2011, 10:24:19 AM »
What happens when you place some ttf fonts into ~/.fonts ?
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline maro

  • Hero Member
  • *****
  • Posts: 1228
Re: opera: fixed window size and true type fonts
« Reply #8 on: January 02, 2011, 07:50:07 PM »
...
sudo sed -i '/^c:.*\/opera /s#$# -geometry 700x500+50+50#' /usr/local/tce.icons && wbar.sh
Just to make sure I understand this correctly, this will add "-geometry 700x500+50+50" right after "/opera" in /usr/local/tce.icons and it will replace it if a -geometry switch is already in there?
...

Not quite. What this SED command does is that it only applies a substitution on a line that starts with 'c:' and contains '/opera ' (this is achieved via the '/^c:.*\/opera /' regular expression that preceeds the substitution command). The substitution is just appending the '-geometry 700x500+50+50' string at the end of the line (via the 's#$#STRING#' command).

Now, if you want to be able to run such a command multiple times and ensure that only the "geometry specification" of the last execution is applied youl'll need something more "involved" like the following (which first "wipes out" any previous "geometry specification" before applying a new one):
    sudo sed -i -e '/^c:.*\/opera /s# -geometry  *[^ ][^ ]*##g' -e '/^c:.*\/opera /s#$# -geometry 705x500+50+50#' /usr/local/tce.icons && wbar.sh

Offline nObRaIn

  • Newbie
  • *
  • Posts: 18
Re: opera: fixed window size and true type fonts
« Reply #9 on: January 03, 2011, 07:32:30 PM »
What happens when you place some ttf fonts into ~/.fonts ?

I tried that again with some ttf fonts I copied from windows into the fonts directory, but it didn't make any difference either. I assume I don't need fontconfig if the fonts are in ~/.fonts, is that correct? I tried it both ways just to make sure, but still...

Thank you for the detailed explanation maro, I'm just beginning to understand now.

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: opera: fixed window size and true type fonts
« Reply #10 on: January 03, 2011, 08:39:36 PM »
What happens when you place some ttf fonts into ~/.fonts ?
I tried that again with some ttf fonts I copied from windows into the fonts directory, but it didn't make any difference either.

wrt what? No visual difference, or fonts not showing up under preferences?
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline nObRaIn

  • Newbie
  • *
  • Posts: 18
Re: opera: fixed window size and true type fonts
« Reply #11 on: January 04, 2011, 06:13:53 AM »
There is no visual difference in web pages, and there are no new fonts under opera's preferences.

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14815
Re: opera: fixed window size and true type fonts
« Reply #12 on: January 04, 2011, 06:32:38 AM »
I just tried unpacking some tt fonts into /usr/local/share/fonts - I could be wrong, but it seemed I needed to use fc-cache and load gtk2 before the fonts showed up in opera preferences..

This was using opera-9.64

Offline nObRaIn

  • Newbie
  • *
  • Posts: 18
Re: opera: fixed window size and true type fonts
« Reply #13 on: January 04, 2011, 12:35:57 PM »
I don't have gtk2 so I can't verify the entire procedure. I tried fc-cache, but it didn't make any difference.

I'm not sure if this is relevant, but I just noticed when I open opera from aterm I get:
ERROR: ld.so: object 'libjvm.so' from LD_PRELOAD cannot be preloaded: ignored.
ERROR: ld.so: object 'libawt.so' from LD_PRELOAD cannot be preloaded: ignored.

edit: I just did a search and it looks like both errors are java related.
« Last Edit: January 04, 2011, 12:39:08 PM by nObRaIn »

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: opera: fixed window size and true type fonts
« Reply #14 on: January 04, 2011, 09:33:00 PM »
boot 'base' 'norestore'
ln -s /pathto/myfonts /home/tc/.fonts
tce-load opera.tcz
opera

--> installed fonts not available

close opera
tce-load fontconfig.tcz
opera

--> installed fonts now available

Also, I found that opera versions 10.62 and 11 have a hard dependency on libfontconfig.so.1 (so they would not start until loading fontconfig.tcz), while 9.64 and opera-10.00-b1 (AFAIK the last version which was available as static qt build) don't.
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)