ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Marcus Vinicius Mesquita <marcusvinicius.mesquita@gmail.com>
To: Hans Hagen <j.hagen@xs4all.nl>
Cc: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: Alphabet & color
Date: Fri, 31 Jul 2020 12:06:51 -0300	[thread overview]
Message-ID: <CAK9ODgR5tk=6rtwFpNBOjyyWGPN0OJXs2+jecLvZFNR1SfAzKQ@mail.gmail.com> (raw)
In-Reply-To: <CAK9ODgQ5MhQFJinq2GsXx9Tnzca5n4ZUng45bOEEdn6hCkpMKw@mail.gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 2871 bytes --]

Hi, again

With the suggestions you gave I managed to obtain the functionality I need,
almost.
Somehow letters with accents like á ã é ó õ and also ç don't get the same
color of the base letters given in the colorfont.lfg below:

return {
     name = "coloralphabet",
     colorschemes = {
         default = {
         [1] = { "A", "a", "á", "ã", "å", "à", "ä" },
         [2] = { "b", "B" },
         [3] = { "c", "ç", "C", "Ç" },
         [4] = { "d", "D" },
         [5] = { "e", "E" },
         [6] = { "f", "F" },
         [7] = { "g", "G" },
         [8] = { "h", "H" },
         [9] = { "i", "í", "ì", "I", "Í", "Ì" },
         [10] = { "j", "J" },
         [11] = { "k", "K" },
         [12] = { "l", "L" },
         [13] = { "m", "M" },
         [14] = { "n", "ñ", "N", "Ñ" },
         [15] = { "o", "ó", "õ", "ö", "O", "Ó", "Õ", "Ö"  },
         [16] = { "p", "P" },
         [17] = { "q", "Q" },
         [18] = { "r", "R" },
         [19] = { "s", "S" },
         [20] = { "t", "T" },
         [21] = { "u", "ù", "ú", "ü", "U", "Ù", "Ú", "Ü" },
         [22] = { "v", "V" },
         [23] = { "w", "W" },
         [24] = { "x", "X" },
         [25] = { "y", "Y" },
         [26] = { "z", "Z" },
         },
     }
}

The MWE follows below:

\setupbodyfont[plex,22pt]

\definecolor[colorscheme:1:1][h=002776]  % a
\definecolor[colorscheme:1:2][h=009c3b]  % b
\definecolor[colorscheme:1:3][h=17737e]  % c
\definecolor[colorscheme:1:4][h=ff5733]  % d
\definecolor[colorscheme:1:5][h=493367]  % e
\definecolor[colorscheme:1:6][h=7c6d11]  % f
\definecolor[colorscheme:1:7][h=117c2a]  % g
\definecolor[colorscheme:1:8][h=6d109d]  % h
\definecolor[colorscheme:1:9][h=08d11a]  % i
\definecolor[colorscheme:1:10][h=a81163] % j
\definecolor[colorscheme:1:11][h=7d2830] % k
\definecolor[colorscheme:1:12][h=2868d1] % l
\definecolor[colorscheme:1:13][h=2c11da] % m
\definecolor[colorscheme:1:14][h=cf47bb] % n
\definecolor[colorscheme:1:15][h=27bde2] % o
\definecolor[colorscheme:1:16][h=dc5777] % p
\definecolor[colorscheme:1:17][h=c28201] % q
\definecolor[colorscheme:1:18][h=ffdf00] % r
\definecolor[colorscheme:1:19][h=30a777] % s
\definecolor[colorscheme:1:20][h=722548] % t
\definecolor[colorscheme:1:21][h=ff00ff] % u
\definecolor[colorscheme:1:22][h=e0115f] % v
\definecolor[colorscheme:1:23][h=004c4c] % w
\definecolor[colorscheme:1:24][h=ae0001] % x
\definecolor[colorscheme:1:25][h=696966] % y
\definecolor[colorscheme:1:26][h=7bb3ff] % z

\definefontfeature
   [MyFeaturesA] [default]
   [goodies={colorfont},colorscheme=default]

\definefont[MyFontA][SerifBold*MyFeaturesA]

\starttext

\setfontcolorscheme[1] {\MyFontA BRASIL brasil órfão ÓRFÃO mão MÃO bênção}

\stoptext

What needs to be changed?

Greetings

Marcus Vinicius

[-- Attachment #1.2: Type: text/html, Size: 4017 bytes --]

[-- Attachment #2: colorfont.lfg --]
[-- Type: application/octet-stream, Size: 1024 bytes --]

return {
     name = "coloralphabet",
     colorschemes = {
         default = {
         [1] = { "A", "a", "á", "ã", "å", "à", "ä" },
         [2] = { "b", "B" },
         [3] = { "c", "ç", "C", "Ç" },
         [4] = { "d", "D" },
         [5] = { "e", "E" },
         [6] = { "f", "F" },
         [7] = { "g", "G" },
         [8] = { "h", "H" },
         [9] = { "i", "í", "ì", "I", "Í", "Ì" },
         [10] = { "j", "J" },
         [11] = { "k", "K" },
         [12] = { "l", "L" },
         [13] = { "m", "M" },
         [14] = { "n", "ñ", "N", "Ñ" },
         [15] = { "o", "ó", "õ", "ö", "O", "Ó", "Õ", "Ö"  },
         [16] = { "p", "P" },
         [17] = { "q", "Q" },
         [18] = { "r", "R" },
         [19] = { "s", "S" },
         [20] = { "t", "T" },
         [21] = { "u", "ù", "ú", "ü", "U", "Ù", "Ú", "Ü" },
         [22] = { "v", "V" },
         [23] = { "w", "W" },
         [24] = { "x", "X" },
         [25] = { "y", "Y" },
         [26] = { "z", "Z" },
         },
     }
}

[-- Attachment #3: mwe.tex --]
[-- Type: text/x-tex, Size: 1442 bytes --]

\setupbodyfont[plex,22pt]

\definecolor[colorscheme:1:1][h=002776]  % a
\definecolor[colorscheme:1:2][h=009c3b]  % b
\definecolor[colorscheme:1:3][h=17737e]  % c
\definecolor[colorscheme:1:4][h=ff5733]  % d
\definecolor[colorscheme:1:5][h=493367]  % e
\definecolor[colorscheme:1:6][h=7c6d11]  % f
\definecolor[colorscheme:1:7][h=117c2a]  % g
\definecolor[colorscheme:1:8][h=6d109d]  % h
\definecolor[colorscheme:1:9][h=08d11a]  % i
\definecolor[colorscheme:1:10][h=a81163] % j
\definecolor[colorscheme:1:11][h=7d2830] % k
\definecolor[colorscheme:1:12][h=2868d1] % l
\definecolor[colorscheme:1:13][h=2c11da] % m
\definecolor[colorscheme:1:14][h=cf47bb] % n
\definecolor[colorscheme:1:15][h=27bde2] % o
\definecolor[colorscheme:1:16][h=dc5777] % p
\definecolor[colorscheme:1:17][h=c28201] % q
\definecolor[colorscheme:1:18][h=ffdf00] % r
\definecolor[colorscheme:1:19][h=30a777] % s
\definecolor[colorscheme:1:20][h=722548] % t
\definecolor[colorscheme:1:21][h=ff00ff] % u
\definecolor[colorscheme:1:22][h=e0115f] % v
\definecolor[colorscheme:1:23][h=004c4c] % w
\definecolor[colorscheme:1:24][h=ae0001] % x
\definecolor[colorscheme:1:25][h=696966] % y
\definecolor[colorscheme:1:26][h=7bb3ff] % z

\definefontfeature
   [MyFeaturesA] [default]
   [goodies={colorfont},colorscheme=default]

\definefont[MyFontA][SerifBold*MyFeaturesA]

\starttext

\setfontcolorscheme[1] {\MyFontA BRASIL brasil órfão ÓRFÃO mão MÃO bênção}

\stoptext

[-- Attachment #4: mwe.pdf --]
[-- Type: application/pdf, Size: 8146 bytes --]

[-- Attachment #5: Type: text/plain, Size: 493 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

  reply	other threads:[~2020-07-31 15:06 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-16  5:32 Marcus Vinicius Mesquita
2020-07-16  7:19 ` Hans Hagen
2020-07-16 16:41   ` Marcus Vinicius Mesquita
2020-07-16 16:57     ` Hans Hagen
2020-07-16 22:02       ` Marcus Vinicius Mesquita
2020-07-31 15:06         ` Marcus Vinicius Mesquita [this message]
2020-07-31 16:31           ` Hans Hagen
2020-07-31 18:00             ` Marcus Vinicius Mesquita
2020-07-31 20:10               ` Marcus Vinicius Mesquita
2020-08-01  9:03                 ` Hans Hagen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAK9ODgR5tk=6rtwFpNBOjyyWGPN0OJXs2+jecLvZFNR1SfAzKQ@mail.gmail.com' \
    --to=marcusvinicius.mesquita@gmail.com \
    --cc=j.hagen@xs4all.nl \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).