9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] links bug
@ 2004-07-22  8:09 Gorka Guardiola Múzquiz
  2004-07-23  9:47 ` Kenji Okamoto
  0 siblings, 1 reply; 6+ messages in thread
From: Gorka Guardiola Múzquiz @ 2004-07-22  8:09 UTC (permalink / raw)
  To: 9fans

I have been playing a little bit with links and got it working for us with
varfont. The problems seems to be with (old code is commented).

/sys/src/cmd/links/dip.c:1960

struct style *g_invert_style(struct style *old)
{
	int length;

	struct style *st;
	st = mem_alloc(sizeof(struct style));
	st->refcount=1;
	st->r0=old->r1;
	st->g0=old->g1;
	st->b0=old->b1;
	st->r1=old->r0;
	st->g1=old->g0;
	st->b1=old->b0;
	st->height=old->height;
	st->flags=old->flags;
	if (st->flags)
	{
		/* We have to get a foreground color for underlining */
		st->underline_color=dip_get_color_sRGB(
			(st->r1<<16)|(st->g1<<8)|(st->b1));
	}
	//length=sizeof(*(st->table))*(n_fonts-1);
	st->table=NULL;	//mem_alloc(length);
	//mem_cpy(st->table,old->table,length);
	st->mono_space=old->mono_space;
	st->mono_height=old->mono_height;
	return st;
}


Trying to copy a table of fonts which is not reserved nor used anywhere else
as far as I have seen. I put it to NULL and everything seems to work for me.
Probably the table field isn't used at all and should disappear, but as
I am not really sure... Links with varfont works for us now.


							G.



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [9fans] links bug
  2004-07-22  8:09 [9fans] links bug Gorka Guardiola Múzquiz
@ 2004-07-23  9:47 ` Kenji Okamoto
  2004-07-23 10:11   ` Kenji Okamoto
  2004-07-23 14:46   ` andrey mirtchovski
  0 siblings, 2 replies; 6+ messages in thread
From: Kenji Okamoto @ 2004-07-23  9:47 UTC (permalink / raw)
  To: 9fans

> I have been playing a little bit with links and got it working for us with
> varfont. The problems seems to be with (old code is commented).

Since Andrey said varfont version of links has some problem, I wondered
what is the problem....     I'm running here the varfont version, and I'm having
no problem (at least looks like so to me).   What is the real problem here...

Kenji



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [9fans] links bug
  2004-07-23  9:47 ` Kenji Okamoto
@ 2004-07-23 10:11   ` Kenji Okamoto
  2004-07-23 11:12     ` Gorka Guardiola Múzquiz
  2004-07-23 14:46   ` andrey mirtchovski
  1 sibling, 1 reply; 6+ messages in thread
From: Kenji Okamoto @ 2004-07-23 10:11 UTC (permalink / raw)
  To: 9fans

> what is the problem....     I'm running here the varfont version, and I'm having
> no problem (at least looks like so to me).   What is the real problem here...

excluding the character width problem for say Japanese literatures.

Kenji



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [9fans] links bug
  2004-07-23 10:11   ` Kenji Okamoto
@ 2004-07-23 11:12     ` Gorka Guardiola Múzquiz
  2004-07-26  2:19       ` Kenji Okamoto
  0 siblings, 1 reply; 6+ messages in thread
From: Gorka Guardiola Múzquiz @ 2004-07-23 11:12 UTC (permalink / raw)
  To: 9fans

>> what is the problem....     I'm running here the varfont version, and I'm having
>> no problem (at least looks like so to me).   What is the real problem here...
>
> excluding the character width problem for say Japanese literatures.

The problem here was that clicking on a form gave a broken links.
Now, with the fix works ok. I'm not using the fonts Andrew provides, so
that may have to do with it too.


									G.



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [9fans] links bug
  2004-07-23  9:47 ` Kenji Okamoto
  2004-07-23 10:11   ` Kenji Okamoto
@ 2004-07-23 14:46   ` andrey mirtchovski
  1 sibling, 0 replies; 6+ messages in thread
From: andrey mirtchovski @ 2004-07-23 14:46 UTC (permalink / raw)
  To: 9fans

>> I have been playing a little bit with links and got it working for us with
>> varfont. The problems seems to be with (old code is commented).
>
> Since Andrey said varfont version of links has some problem, I wondered
> what is the problem....     I'm running here the varfont version, and I'm having
> no problem (at least looks like so to me).   What is the real problem here...
>
> Kenji

i think Gorka fixed it, whatever it was...  sorry, i just don't play
with varfont links all that much.

andrey



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [9fans] links bug
  2004-07-23 11:12     ` Gorka Guardiola Múzquiz
@ 2004-07-26  2:19       ` Kenji Okamoto
  0 siblings, 0 replies; 6+ messages in thread
From: Kenji Okamoto @ 2004-07-26  2:19 UTC (permalink / raw)
  To: 9fans

> The problem here was that clicking on a form gave a broken links.

I haven't this problem though...

My Font definitions are as follows:
in plan9.c file;

-------from here-------
static uchar *
plan9_init_driver(uchar *param, uchar *d)
{
	int i;
	char *tmp;

#ifdef PLAN9_DEBUG
	MESSAGE("plan9 init driver\n");
#endif
	if(initdraw(nil, nil, "flame") < 0)
		exits("initdraw failed");

	for (i = 0; i < 256; i++)
		colors[i] = allocimage(display, Rect(0, 0, 1, 1), screen->chan,
			1, cmap2rgba(i));

	/* normal fonts, the defaults are rather small */
	tmp = getenv("Font11");
	if(tmp != nil)
		fnt[Font11] = plan9_loadfont(tmp);
	else
		fnt[Font11] = plan9_loadfont("/lib/font/bit/lucidasans/unicode.6.font");

	tmp = getenv("Font13");
	if(tmp != nil)
		fnt[Font13] = plan9_loadfont(tmp);
	else
		fnt[Font13] = plan9_loadfont("/lib/font/bit/lucidasans/unicode.7.font");

	tmp = getenv("Font15");
	if(tmp != nil)
		fnt[Font15] = plan9_loadfont(tmp);
	else
		fnt[Font15] = plan9_loadfont("/lib/font/bit/lucidasans/unicode.8.font");

	tmp = getenv("Font19");
	if(tmp != nil)
		fnt[Font19] = plan9_loadfont(tmp);
	else
		fnt[Font19] = plan9_loadfont("/lib/font/bit/lucidasans/unicode.10.font");

	tmp = getenv("Font26");
	if(tmp != nil)
		fnt[Font26] = plan9_loadfont(tmp);
	else
		fnt[Font26] = plan9_loadfont("/lib/font/bit/lucidasans/unicode.13.font");

	/* italic fonts */
	tmp = getenv("FontItal11");
	if(tmp != nil)
		fnt[FontItal11] = plan9_loadfont(tmp);
	else
		fnt[FontItal11] = plan9_loadfont("/lib/font/bit/lucidasans/italicunicode.6.font");

	tmp = getenv("FontItal13");
	if(tmp != nil)
		fnt[FontItal13] = plan9_loadfont(tmp);
	else
		fnt[FontItal13] = plan9_loadfont("/lib/font/bit/lucidasans/italicunicode.7.font");

	tmp = getenv("FontItal15");
	if(tmp != nil)
		fnt[FontItal15] = plan9_loadfont(tmp);
	else
		fnt[FontItal15] = plan9_loadfont("/lib/font/bit/lucidasans/italicunicode.8.font");

	tmp = getenv("FontItal19");
	if(tmp != nil)
		fnt[FontItal19] = plan9_loadfont(tmp);
	else
		fnt[FontItal19] = plan9_loadfont("/lib/font/bit/lucidasans/italicunicode.10.font");

	tmp = getenv("FontItal26");
	if(tmp != nil)
		fnt[FontItal26] = plan9_loadfont(tmp);
	else
		fnt[FontItal26] = plan9_loadfont("/lib/font/bit/lucidasans/italicunicode.13.font");

	/* bold fonts */
	tmp = getenv("FontBold11");
	if(tmp != nil)
		fnt[FontBold11] = plan9_loadfont(tmp);
	else
		fnt[FontBold11] = plan9_loadfont("/lib/font/bit/lucidasans/boldunicode.6.font");

	tmp = getenv("FontBold13");
	if(tmp != nil)
		fnt[FontBold13] = plan9_loadfont(tmp);
	else
		fnt[FontBold13] = plan9_loadfont("/lib/font/bit/lucidasans/boldunicode.7.font");

	tmp = getenv("FontBold15");
	if(tmp != nil)
		fnt[FontBold15] = plan9_loadfont(tmp);
	else
		fnt[FontBold15] = plan9_loadfont("/lib/font/bit/lucidasans/boldunicode.8.font");

	tmp = getenv("FontBold19");
	if(tmp != nil)
		fnt[FontBold19] = plan9_loadfont(tmp);
	else
		fnt[FontBold19] = plan9_loadfont("/lib/font/bit/lucidasans/boldunicode.10.font");

	tmp = getenv("FontBold26");
	if(tmp != nil)
		fnt[FontBold26] = plan9_loadfont(tmp);
	else
		fnt[FontBold26] = plan9_loadfont("/lib/font/bit/lucidasans/boldunicode.13.font");

	/* typescript */
	tmp = getenv("FontType11");
	if(tmp != nil)
		fnt[FontType11] = plan9_loadfont(tmp);
	else
		fnt[FontType11] = plan9_loadfont("/lib/font/bit/lucidasans/typeunicode.6.font");

	tmp = getenv("FontType13");
	if(tmp != nil)
		fnt[FontType13] = plan9_loadfont(tmp);
	else
		fnt[FontType13] = plan9_loadfont("/lib/font/bit/lucidasans/typeunicode.7.font");

	tmp = getenv("FontType15");
	if(tmp != nil)
		fnt[FontType15] = plan9_loadfont(tmp);
	else
		fnt[FontType15] = plan9_loadfont("/lib/font/bit/lucidasans/typeunicode.9.font");

	tmp = getenv("FontType19");
	if(tmp != nil)
		fnt[FontType19] = plan9_loadfont(tmp);
	else
		fnt[FontType19] = plan9_loadfont("/lib/font/bit/lucidasans/typeunicode.12.font");

	tmp = getenv("FontType26");
	if(tmp != nil)
		fnt[FontType26] = plan9_loadfont(tmp);
	else
		fnt[FontType26] = plan9_loadfont("/lib/font/bit/lucidasans/typeunicode.16.font");

	eresized(0);
	watchevents();
	return nil;
}
---------end here-----

Kenji

PS. I believe all the definitions and font files are found in our web site.



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2004-07-26  2:19 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-07-22  8:09 [9fans] links bug Gorka Guardiola Múzquiz
2004-07-23  9:47 ` Kenji Okamoto
2004-07-23 10:11   ` Kenji Okamoto
2004-07-23 11:12     ` Gorka Guardiola Múzquiz
2004-07-26  2:19       ` Kenji Okamoto
2004-07-23 14:46   ` andrey mirtchovski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).