Tiny Core Linux

Tiny Core Extensions => TCE Q&A Forum => Topic started by: nObRaIn on December 31, 2010, 09:42:46 AM

Title: opera: fixed window size and true type fonts
Post by: nObRaIn 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.
Title: Re: opera: fixed window size and true type fonts
Post by: roberts 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
Title: Re: opera: fixed window size and true type fonts
Post by: tinypoodle 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.
Title: Re: opera: fixed window size and true type fonts
Post by: nObRaIn 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?
Title: Re: opera: fixed window size and true type fonts
Post by: tinypoodle 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?
Title: Re: opera: fixed window size and true type fonts
Post by: maro 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.
Title: Re: opera: fixed window size and true type fonts
Post by: nObRaIn 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.
Title: Re: opera: fixed window size and true type fonts
Post by: tinypoodle on January 02, 2011, 10:24:19 AM
What happens when you place some ttf fonts into ~/.fonts ?
Title: Re: opera: fixed window size and true type fonts
Post by: maro 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
Title: Re: opera: fixed window size and true type fonts
Post by: nObRaIn 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.
Title: Re: opera: fixed window size and true type fonts
Post by: tinypoodle 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?
Title: Re: opera: fixed window size and true type fonts
Post by: nObRaIn 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.
Title: Re: opera: fixed window size and true type fonts
Post by: Juanito 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
Title: Re: opera: fixed window size and true type fonts
Post by: nObRaIn 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.
Title: Re: opera: fixed window size and true type fonts
Post by: tinypoodle 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.
Title: Re: opera: fixed window size and true type fonts
Post by: tinypoodle on January 04, 2011, 09:35:31 PM
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.

It is totally irrelevant to anything else than having java work in opera.
Title: Re: opera: fixed window size and true type fonts
Post by: nObRaIn on January 06, 2011, 07:40:22 PM
I'm sorry for the late reply, I've been a bit busy but I'm still trying to find a solution.

So I tried with fontconfig loaded and some tt fonts in ~/.fonts but it is still not working. Unfortunately I can't realy try booting with 'base' right now as I don't have access to a wired network but I will give it a try tommorow just to make sure nothing gets in the way.

Apart from fontconfig I only have wpa_supplicant, ntfs-3g and firmware-iwlwifi loaded on boot, and ofcourse all of their deps (expat2, openssl, wireless_tools, wireless). Other than that, my setup is a basic tc 3.4. Is there anything else that could be causing the issue? or anything more I could test?

Title: Re: opera: fixed window size and true type fonts
Post by: tinypoodle on January 06, 2011, 09:25:50 PM
Well, personally I use the same ~/.fonts under various Linux systems since many years.

So, in the dir where the real font files reside I ran mkfontdir and mkfontscale, which would result in:

Code: [Select]
tc@box:~$ ls -Ll .fonts/fon*
-rw-r--r--    1 tc       staff       46511 Jul  8  2010 .fonts/fonts.dir
-rw-r--r--    1 tc       staff       46511 Jul  8  2010 .fonts/fonts.scale

I do not know if that even should or would make a difference or not with fontconfig.tcz loaded.

P.S.: this procedure would only have to be repeated when content of the dir gets changed.
Title: Re: opera: fixed window size and true type fonts
Post by: tinypoodle on January 07, 2011, 02:35:40 AM
Did another experiment to check that.

boot 'base'
mkdir .fonts
cd /pathto/myfonts
cp  a* b* c* d* ... z* /home/tc/.fonts #all fonts, excluding fonts.dir & fonts.scale
tce-load -i opera10.tcz #auto loads fontconfig.tcz as dependency, amongst others
opera

--> installed fonts all available, antialiasing present


Title: Re: opera: fixed window size and true type fonts
Post by: nObRaIn on January 07, 2011, 03:21:44 PM
I did get the opportunity to experiment a little with tc base today, but I still can't replicate any of your results.

I did load Xorg-fonts and fontconfig and then tried loading opera and opera10 (not at the same time). In both cases the fonts were not available in opera. I then tried loading chromium-browser that I remember trying some time ago with ttfs, and it did work right away. Opera (both versions actually) is also using the new fonts after loading chromium, so it seems that I need one (or more) of chromium's deps in order to use ttf fonts.

Does any of that sound reasonable? and if so, what can be different between two tc setups when loaded with 'base'?
Title: Re: opera: fixed window size and true type fonts
Post by: tinypoodle on January 07, 2011, 03:48:29 PM
FWIW, running 2.10 here, and my last test had been executed with restored backup - except from replacing the .fonts link with a dir and copying fonts to exclude the availability of fonts.dir & fonts.scale.

I had a peek at deps of chromium-browser (yikes at size), and on a mild suspicion, give libxft.tcz a try (libxft is included in 2.10 base and in chromium-browser deps) and report back.
Title: Re: opera: fixed window size and true type fonts
Post by: nObRaIn on January 07, 2011, 05:33:13 PM
Thanks for that. I didn't really know where to start trying all of chromium's deps. Loading libxft did the trick though. It would be a good idea updating opera's info after that.

Thank you all for the help, I really appreciate it.

Title: Re: opera: fixed window size and true type fonts
Post by: curaga on January 07, 2011, 05:37:13 PM
Thanks for that. I didn't really know where to start trying all of chromium's deps. Loading libxft did the trick though. It would be a good idea updating opera's info after that.

Updated.
Title: Re: opera: fixed window size and true type fonts
Post by: tinypoodle on January 07, 2011, 06:30:41 PM
libxft - being a dep of gtk2 - could also be a plausible explanation why juanito reported fonts working after installing gtk2.

nObRaIn,
glad you finally got it to work, and hopefully this info will benefit others; adding a [SOLVED] to subject of first post of thread could not harm  ;)
Title: Re: opera: fixed window size and true type fonts
Post by: tinypoodle on January 28, 2011, 02:25:15 PM
This may give some insight:

http://my.opera.com/desktopteam/blog/more-unix-font-work