Entropic quantization of scalar fields