From the equipment section of the 1923 American Type Founders Specimen Book and Catalogue
To be “out of sorts” derives from printers’ jargon—meaning to run out of needed letters in a drawer or ‘case’ of metal foundry type. The term ‘upper and lower case’ derives from the drawers that type was stored in—caps in the upper case and minuscules in the lower case.
“I operated a Linotype in the late 1970s, setting hot lead slugs of type. My coworker, Harry, would set up the Heidelberg windmill presses, get them both running, and then stand in front of the cases setting type, deftly choosing sorts (individual pieces of metal foundry type) from the California Job Cases with his free hand and placing them in the composing stick in his other hand. Harry was deaf, so the noise of the shop (we also had two offset duplicators running much of the time), or the jarring crash of a metal galley dropped on the concrete floor never bothered him. When we’d “throw in,” that is dump galleys of type onto the granite countertop to be replaced into the job cases, Harry had no trouble distinguishing sorts. The p, d, b, and q all looked the same to me, but they didn’t slow Harry in the least.”