|
From: <pl...@pi...> - 2011-10-21 08:27:33
|
On 10/21/11 07:32, sfeam (Ethan Merritt) wrote: > On Thursday, 20 October 2011, pl...@pi... wrote: >> In this context the title is quite visible and underlines look a bit >> untidy. Hence my interest in getting a more presentable title displayed >> by the browser. > > So I just tried to implement this, and I can't get it to work. > Maybe your version of Firefox is different? > > When I open the svg file in Firefox the behaviour of the individual > <title = "name_plot_1"> elements works as intended: when the mouse > is over the plot with that title, a little box pops up displaying > the title. > > Separate from that, the title of the first plot in the file is also > displayed in the top border window decoration, which is I think > what you are talking about, right? (I'm running KDE with a theme > that has this; I don't know what happens if you're running a desktop > or theme that doesn't place an extra decoration bar on the top). > OK, I have attached a screenshot that probably won't get through the ML but you are on CC so at least you should get it. I see FF using svg title in two places. The browser window title bar as you describe above. With an html document this shows the html title so this seems consistent and correct. Also I see it in the browser tab. I suspect this is configurable in FF options so you may or may not see that. ( this is firefox 3.6.20 ) I have given up using opera for svg since it opens local svg files as text. A bug I reported over a year ago and remains AFAIK unaddressed. I have to upload somewhere and access via http so I no long bother. I manually edited the svg as follows and FF tab and title bar now show the modified title with spaces. <g id="25u50u_25cZZ_plot_1" ><title>25u50u 25cZZ plot 1</title> It seems FF is just grabbing the first occurrence of ANY title element, this may not be that logical. If the intent is to have an svg title for the file maybe that can best be addressed by adding a new svg element near the head of the file. I just tried this between <desc> and <script> tags and it works. I believe that is correct usage but you may like to check. I suspect FF picking up the plot element's title may be a bug , but explicitly adding a title to the file would seem to be the correct approach for situations where a viewer displays it. This also works with Opera , it is only displaying the file name as you noted because there is no title tag in the document. This is probably what FF should be doing as well. So adding a new title tag for the document as a whole seems the right thing to do. A trivial mod. Using any specified "title" option also as the base text for the plot titles would allow control of the text shown in the hint box you describe too. (I don't think there are any distro/desktop issues complicating this.) Regards, Peter. > But when I tried adding an additional title in various svg elements > near the top of the file to see if that replaced the one on the > window border - it didn't. So at this moment I don't know how to do it. > If you have a sample file produced by some other program that behaves > the way you like, why don't you send it to me and I'll see if I can > figure out how they did it. > > cheers, > > Ethan > > |