The more I play with this the more I think there is a bug. I created a new
font and added it to the font defaults. it shows up in the defaults list and
'looks' exactly like the rest of the fonts there. I can create an Atom and
set it's font to 'bold-large' and that works perfect. But when I try and set
it to my new font, I get the following error stack trace:

5129812 DEBUG: qx.ui.basic.Atom[]: Current stack trace
at qx.log.MLogging:printStackTrace://localhost/swep.js
at http://localhost/swep.js:2133
at http://localhost/swep.js:2144
at javascript: with (__scope__.vars) { with (__scope__.api) { with
(__scope__.userVars) { with (window) {try
{__scope__.callback(eval(__scope__.expr));} catch (exc)
{__scope__.callback(exc, true);}}}}}:1
at javascript: with (__scope__.vars) { with (__scope__.api) { with
(__scope__.userVars) { with (window) {try
{__scope__.callback(eval(__scope__.expr));} catch (exc)
{__scope__.callback(exc, true);}}}}}:1


here is the code I used to create the font:


qx.Theme.define("swep.fonts4",
{
  title : "Customx",

  fonts :
  {
    "blue3" :
    {
      size : 14,
      family : [ "Lucida Grande", "Tahoma", "Verdana", "Bitstream Vera
Sans", "Liberation Sans" ]
    }
   }
});
qx.Theme.include(qx.theme.classic.font.Default, swep.fonts4);

and when you use FireBug to examine the details of qx.Theme.getAll(), you
see the new font in the qx.theme.classic.font.Default list with the correct
settings. So everything appears correct, but it just can't be used. I tried
this route thinking that if I could get a custom font to work I could then
just assign that font name to the custom appearance I was trying to create.
I think this will be my best bet if any of this works in the long run.

So what am I doing wrong, or is this a bug?

Thanks,
Jim




On 8/23/07, Jim Hunter <[EMAIL PROTECTED]> wrote:
>
> Apparently the syntax is not 100% correct. no matter how I try and format
> it, if I include a font reference it does not work. Using the following
> syntax allws the appearances to be registered (I can see them in the list
> when I do a qx.Theme.getAll() ) but when you try and actually apply one of
> them I get an error and program execution stops:
>
>
> qx.Theme.define("swep.Appearance", {title: "swepAppear", appearances: {
> "SFREGULARTEXT" :
> {
>   style : function(states)
>   {
>     var myfont = new qx.ui.core.Font(12, ["Arial"]);
>     return
>     {
>       font: myfont,
>       textColor: "Black"
>     }
>   }
> }
> }})
>
>
>
> If I remove the font information and just leave the textColor then I am
> able to apply that appearance to an object with no errors. I even tried this
> syntax (culling the syntax from sourcode):
>
> qx.Theme.define("swep.Appearance", {title: "swepAppear", appearances: {
> "SFREGULARTEXT" :
> {
>   style : function(states)
>   {
>     return
>     {
>       font: { size 11, bold: true, family : ["Arial"]},
>       textColor: "Black"
>     }
>   }
> }
> }})
>
>
>
> but this syntax also causes the program to stop executing.
>
>
>
> Any help would be greatly appreceiated, thanks, I need to create and apply
> custome appearances that have Font information in them.
>
> Thanks,
>
> Jim
>
>
>
>
>
> On 7/31/07, Fabian Jakobs <[EMAIL PROTECTED]> wrote:
> >
> > Jim Hunter schrieb:
> > > Great info, thanks. What is the syntax for declaring something like
> > > BOLD or LINE-THROUGH for the font? I used to do it with an additional
> > > line of: this.font.setUnderline(true) or this.font.setItalic(true)
> > > etc. Is it still the same? Where does that line now go? Previously I
> > > would create the font before the Return statement and set the
> > > properties, perhaps that is still the case? Would it look like this:
> > >
> > > qx.Theme.define("custom.Appearance",
> > > {
> > >  name : "foo",
> > >
> > >  appearances :
> > >  {
> > >    "SFREGULARTEXT" : {
> > >      style : function(states) {
> > >        font : new qx.ui.core.Font(12, ["Arial"]);
> > >        font.setBold(true);
> > >        font.setUnderline(true);
> > >        return {
> > >                     font;
> > >                     textColor : "black"
> > >        }
> > >      }
> > >    },
> >
> > It looks slightly different:
> >
> > appearances :
> > {
> >   "SFREGULARTEXT" : {
> >     style : function(states) {
> >       font = new qx.ui.core.Font(12, ["Arial"]);
> >       font.setBold(true);
> >       font.setUnderline(true);
> >       return {
> >                    font : font,
> >                    textColor : "black"
> >       }
> >     }
> >   },
> >
> > Best Fabian
> > >
> > >    "SFHIGHLIGHTEDTEXT" : {
> > >      style : function(states) {
> > >        return {
> > >           font : new qx.ui.core.Font(12, ["Arial"]);
> > >           textColor : "black"
> > >        }
> > >      }
> > >    },
> > >
> > >    ...
> > >
> > >  }
> > > }
> > >
> > > Thanks,
> > > Jim
> > > www.D4PHP.org <http://www.d4php.org/> 
> > > <http://www.D4PHP.org<http://www.d4php.org/>
> > >
> > > www.D4PHP-Hosting.com <http://www.d4php-hosting.com/> 
> > > <http://www.D4PHP-Hosting.com<http://www.d4php-hosting.com/>
> > >
> > >
> > >
> > >
> > >
> > > On 7/30/07, *Fabian Jakobs* <[EMAIL PROTECTED]
> > > <mailto: [EMAIL PROTECTED]>> wrote:
> > >
> > >     Hi Jim,
> > >     > I just migrated to 0.7.2-pre (r9171) and my appearances are
> > >     generating
> > >     > errors when I try and run the app. I looked in the API viewer to
> >
> > >     see
> > >     > what the new structure is and it says:
> > >     Are you using trunk or the legacy_0_7 branch? I would strongly
> > suggest
> > >     to use legacy_0_7. This is where all 0.7 related bugs are fixed.
> > Since
> > >     we are now starting to work on the layout managers, the trunk is
> > >     expected to be fairly instable for the next time.
> > >
> > >     > qx.theme.manager.Appearance.getAppearanceTheme ()
> > >     >
> > >     > is the way to get the instance of the current theme but I get an
> > >     error
> > >     > 'is not a function" error. So what is the new way to register a
> > >     theme?
> > >     > I don't see any docs on it and the migration script couldn't
> > help me
> > >     > as this is code that is generated from the server (I just
> > created a
> > >     > test file and migrated it and got the same resulting line). Here
> > >     is a
> > >     > sample of what I am generating:
> > >     >
> > >     > theme = qx.theme.manager.Appearance.getAppearanceTheme();
> > >     > theme.registerAppearance("SFREGULARTEXT",{ setup: function(){
> > >     > this.font = new qx.renderer.font.Font (12,"Arial");}, initial:
> > >     > function(){ return { font: this.font, color: "Black"}; }});
> > >     > theme.registerAppearance("SFHIGHLIGHTEDTEXT",{ setup:
> > function(){
> > >     > this.font = new qx.renderer.font.Font(12,"Arial");}, initial:
> > >     > function(){ return { font: this.font, color: "Black"}; }});
> > >     > theme.registerAppearance("SFHOTTEXT",{ setup: function(){
> > >     this.font =
> > >     > new qx.renderer.font.Font(12,"Arial");}, initial: function(){
> > >     return {
> > >     > font: this.font, color: "Black"}; }});
> > >
> > >     The whole way we handle appearances has changed a lot. The
> > function
> > >     "registerAppearance" no longer exist. If you want to extend an
> > already
> > >     existing theme you can define the apperances in a separate
> > appearance
> > >     theme and use the mixin mechanism to apply the
> > >     changes/enhancements to
> > >     an existing appearance theme.
> > >
> > >     Example for your code:
> > >
> > >     custom/Appearance.js:
> > >
> > >     qx.Theme.define("custom.Appearance ",
> > >     {
> > >     name : "foo",
> > >
> > >     appearances :
> > >     {
> > >        "SFREGULARTEXT" : {
> > >          style : function(states) {
> > >            return {
> > >               font : new qx.ui.core.Font(12, ["Arial"]);
> > >               textColor : "black"
> > >            }
> > >          }
> > >        },
> > >
> > >        "SFHIGHLIGHTEDTEXT" : {
> > >          style : function(states) {
> > >            return {
> > >               font : new qx.ui.core.Font(12, ["Arial"]);
> > >               textColor : "black"
> > >            }
> > >          }
> > >        },
> > >
> > >        ...
> > >
> > >     }
> > >     }
> > >
> > >     And in your application you include it:
> > >
> > >     qx.Theme.include(qx.theme.classic.Appearance , custom.Appearance);
> > >
> > >     > And also, 'MS Sans Serif' is no longer a valid font name whereas
> > it
> > >     > has been for years. What do I use in place of 'MS Sans Serif'?
> > >     The font name should be valid but the second parameter of the font
> >
> > >     constructor is now a string array. Take a look at the example
> > above.
> > >     Another note: the property color has been renamed to test color to
> > be
> > >     more specific and better match to the backgroundColor property.
> > >
> > >     I hope this helps,
> > >     Best Fabian
> > >
> > >     --
> > >     Fabian Jakobs
> > >     JavaScript Framework Developer
> > >
> > >     1&1 Internet AG
> > >     Brauerstraße 48
> > >     76135 Karlsruhe
> > >
> > >     Amtsgericht Montabaur HRB 6484
> > >
> > >     Vorstand: Henning Ahlert, Ralph Dommermuth, Matthias Ehrlich,
> > >     Andreas Gauger, Matthias Greve, Robert Hoffmann, Norbert Lang,
> > >     Achim Weiss
> > >     Aufsichtsratsvorsitzender: Michael Scheeren
> > >
> > >
> > >
> > -------------------------------------------------------------------------
> > >     This SF.net email is sponsored by: Splunk Inc.
> > >     Still grepping through log files to find problems?  Stop.
> > >     Now Search log events and configuration files using AJAX and a
> > >     browser.
> > >     Download your FREE copy of Splunk now >>   http://get.splunk.com/
> > >     _______________________________________________
> > >     qooxdoo-devel mailing list
> > >     qooxdoo-devel@lists.sourceforge.net
> > >     <mailto:qooxdoo-devel@lists.sourceforge.net>
> > >     https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
> > >     <https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel>
> > >
> > >
> > >
> > ------------------------------------------------------------------------
> > >
> > >
> > -------------------------------------------------------------------------
> > > This SF.net email is sponsored by: Splunk Inc.
> > > Still grepping through log files to find problems?  Stop.
> > > Now Search log events and configuration files using AJAX and a
> > browser.
> > > Download your FREE copy of Splunk now >>   http://get.splunk.com/
> > >
> > ------------------------------------------------------------------------
> > >
> > > _______________________________________________
> > > qooxdoo-devel mailing list
> > > qooxdoo-devel@lists.sourceforge.net
> > > https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
> > >
> >
> >
> > --
> > Fabian Jakobs
> > JavaScript Framework Developer
> >
> > 1&1 Internet AG
> > Brauerstraße 48
> > 76135 Karlsruhe
> >
> > Amtsgericht Montabaur HRB 6484
> >
> > Vorstand: Henning Ahlert, Ralph Dommermuth, Matthias Ehrlich, Andreas
> > Gauger, Matthias Greve, Robert Hoffmann, Norbert Lang, Achim Weiss
> > Aufsichtsratsvorsitzender: Michael Scheeren
> >
> >
> >
> > -------------------------------------------------------------------------
> > This SF.net email is sponsored by: Splunk Inc.
> > Still grepping through log files to find problems?  Stop.
> > Now Search log events and configuration files using AJAX and a browser.
> > Download your FREE copy of Splunk now >>  http://get.splunk.com/
> > _______________________________________________
> > qooxdoo-devel mailing list
> > qooxdoo-devel@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
> >
>
>
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
qooxdoo-devel mailing list
qooxdoo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to