What is the origin of gramarye?

Gramarye “occult learning” is a doublet of grammar, and both derive via Old French gramaire and Latin gramatica from Ancient Greek grammatikḕ (téchnē) “grammatical (art),” from grammatikós “knowing one’s letters” and earlier grámma “letter, something drawn; small weight.” The story of how an ancient word for “letter” evolved into gramarye, grammar, and even glamour (via Scots) is full of semantic twists and turns. The sense “knowledge of letters” shifted to the broader definition of “the study of how a language’s sentences are constructed,” and this is the definition of grammar today. In the Middle Ages, because grammar was taught only among the upper classes, grammar became a symbol of general “higher” learning, which also included subjects such as astrology, magic, and the occult at the time. Glamour and gramarye are simply variants of grammar that kept this connection to magic, though glamour later shifted again to refer to enchantingly good looks. Gramarye was first recorded in English in the early 1300s.