Curl Global Community
Curl equivalent to CSS unicode-range - Printable Version

+- Curl Global Community (https://communities.curl.com)
+-- Forum: Discussions (https://communities.curl.com/forumdisplay.php?fid=1)
+--- Forum: General Curl questions (https://communities.curl.com/forumdisplay.php?fid=2)
+--- Thread: Curl equivalent to CSS unicode-range (/showthread.php?tid=959)



Curl equivalent to CSS unicode-range - RobertShiplett - 08-27-2013

Does anyone have an idea for a Curl equivalent to CSS unicode-range in font declaration for @font-face ?
My need is to have light hiragana and katakana but more strongly-stroked kanji characters and bold mono radical characters.
I have not been able to find font really suitable to kanji recognition for gai-jin learning nihongo no kanji .
The HTML unicode-range option in declaring a @font-face does permit the intended presentation style.
Thanks



RE: Curl equivalent to CSS unicode-range - umemura - 08-27-2013

I think it's impossible to declare font of each curl's character object like @font-face...

Code:
{define-class public FontFaceCharGraphic {inherits CharGraphic}

  def first-kanji:int = '亜' asa int
  def last-kanji:int = '腕' asa int

  field char:char

  {constructor public {default c:char, ...  }
    {construct-super c, {splice ...}}
    set self.char = c
    {self.change-style}
  }

  {method {change-style}:void
    def u = self.char asa int
    {if u >= {this-class}.first-kanji  and u <= {this-class}.last-kanji  then
        set self.font-weight = FontWeight.bold
    else
        set self.font-weight = FontWeight.normal
    }
    {output self.c , ":", u}
  }

  {method public {add g:any, ...}:#Visual
    {type-switch value
    case c:char do
        set self.char = c
        {self.change-style}
    }
    {return  {super.add g, {splice ...}}}

  }
}

{define-class public  StringFrame {inherits HBox}
  {constructor public {default str:String}
    {for c in str do
        {self.add {FontFaceCharGraphic c}}
    }
  }
}

{def f = {StringFrame  "fist-kanji:字[ 1-9, a-Z, ()+*, あいうえお 日本] last-kanji:腕"}}

{value f}



RE: Curl equivalent to CSS unicode-range - white123 - 10-23-2013

I will let you know if this works for me Thanks and keep posting such a informative blogs.