James Lock & Company is London's oldest, most famous hatter. The name is an institution and the shop front classified an "ancient monument." But perhaps Lock's chief claim to distinction lies in fact that in 1850, at the request of William Coke - a country gentleman and member of the Earl of Leicester's family who wanted an alternative to his high-crowned beaver hat that was knocked off by low branches when he went riding - Lock created a low-crowned, fur-felt artifact strengthened with shellac - the first bowler or "coke." Little did either party think they were starting a fashion that would eventually lead to the production of 70,000 bowlers a year and that they would be sure of immortality as long as The City, the Foreign Office and the Civil Service flourish.

"Since we are not manufacturers, the hat was originally made to our specifications by the firm of Thomas and William Bowler, but we still list it in our catalogue as a Coke Hat because Mr. Coke bespoke it," says Richard Stephenson, Lock's present manager, a pleasant, dignified man and a descendant of the first Lock who in 1676 established his shop "to wait upon Nobility and Gentry," at the nearby Court of St. James.

When the new hat was ready, Coke came to try it on. I t was comfortable but would it stay on, undamaged, even if the wearer encountered overhanging branches? Coke put it on the floor and jumped on it. The hat remained round, undented. Coke was delighted. How much? Twelve shillings. He paid, ordered several for his gamekeepers and left.

Nowadays the bowler or coke (Americans call it a derby because they first saw it at Epsom races, took it home, with them but then pronounced it "durby"), can be ordered in light or medium weight (17.50 British pounds) while the hunting weight cost 22 pounds.

Lock's window are one of the sights of St. James Street, not only for their ancient glazing and diminutive panes and because the great hatter has embellished the with some trendy, modern headgear, but also with a number of historic hats from the firm's collection, including the plumed "cock't fore and aft," worn by the Duke of Wellington at Waterloo. There is also Lord Nelson's cocked hat with its jaunty cockade and a cavalry hat embroidered and crowned with an imposing Prussian feather that has been traced to Cornet Andre Spotiswode, of the Light Horse Volunteer Regiment, who bought it at Lock's in 1817 and paid six guineas plus an extra half a guinea for the feather.

Inside, the simple showroom with its low ceilings, uneven floor and walls covered in black paneling has "the atmosphere of a shop connected with hunting and horses, country gentlemen and country ladies." Near the door is a high-old-fashioned accounts desk. Along one wall stands a magnificent 18th-century great grandfather clock. On another wall hangs a framed bill for two fine beaver hats, six double silk cockades and a double cockade supplied to the Duke of Bedford in 1750 for a total cost of about 2 pounds. There is also a framed copy of the royal warrant appointing Lock as hatter to the Duke of Edinburgh.

Other famous customers, or "people of fascination" as Henry Fielding called them, have included the Duke of Windsor, Prince Charles and Princess Ann. (Lock designs their hunting caps), Charles de Gaulle, Francis Chichester, the Mellons, Rockefellers, Frank Sinatra and Gregory Peck.

Every U.S. ambassador to the Court of St. James has had Lock make his glossy silk black top hat. During the early part of this century, the black topper was also de rigeur for weddings, funerals and Sunday church parades. Today, silk plush is hard to get and black toppers are ordered chiefly by diplomats and judges. The ordinary Man About Town is content to make do with his one gray topper (known as a drab shell) which will last him a lifetime, provided he is easy on the hair oil or simply carries it. Lock sells three gross of these a season.

They also stock the traditional homburg, wide-brimmed felt hats brought by both men and women, and tweed caps known as the Rex Harrison model. Their least expensive hat (at 4 pounds) is made of crushed toweling.

With the increase in leisure time and the switch to more casual town-wear, sales of tweed caps and hats have quadrupled in the last five years in England and the United States (Lock's biggest export market).

"The sale of bowlers - the business hat until the 1950s - has dropped, but an appreciable demand continues, especially among the Old Guard and Establishment types," Stephenson says.

Each new customer has an impression taken of his head by a wood and metal device invented by French and called a conformateur. From this is made a "conform card," which goes into the company's files (reaching from floor to ceiling) so that on future occasions, provided his head remains the same, all the owner has to do is send a postcard or, like one famous 19th-century prime minister, the Earl of Roseberry, stand in the door of the shop and shout, "HAT!". "Since His lordship's size and favorite style was known we were able to accommodate him immediately," says Stephenson.

The conform cards have proved invaluable in tracing misplaced hats but they are something of a trap to those gentlemen who refuse to believe that age or weight can make a difference to head size. Lock has had to pacify more than one septuagenarian who insisted the measurements taken when he was 20 would do for his present day requirements.

The cards have also provided evidence that American heads are slightly larger and longer than English ones, that Slav leaders are rounder and that the size of the average Englishman's head has increased three-eighths of an inch since World War I.

A Lock hat has, on occasion, caused problems. The King of Afghanistan, on a visit to London in 1930, was so impressed by the bowlers worn by his Scotland Yard bodyguard that he ordered a dozen to take home with him, certain that his subjects would be quick to adopt this dignified style in place of the old-fashioned fez. Unfortunately his majesty had forgotten prayers: A Muslim must touch his head to the ground when he prays which is easy wearing a fez but impossible with a bowler. Obsequious courtiers hastily snipped off the brims of the brand-new bowlers. But came the revolution, his majesty lost his throne and Lock lost a bulk order for unbrimmed bowlers.

The mood and flavor of the shop was perhaps summed up not so long ago when one of their younger customers, an impoverished lord whose last two checks had been returned to the bank marked "refer to drawer" walked calmly into the shop to have his hat brushed.

Hearing the demand and recognizing the voice, the manager stepped forward to remostrate. The altercation was short and ended with a brushed hat and laughter all around. Stephenson explained later that his lordship was really rather sporting: He had promptly repaid the fiver he has borrowed from the cashier before demanding attention for his hat. Smilingly the manager added, "And after all, we've been shaping the hats of the family for more than five generations."