We show that, assuming GCH, if κ is a Ramsey or a strongly Ramsey cardinal and F is a class function on the regular cardinals having a closure point at κ and obeying the constraints of Easton's theorem, namely, F(α)≤F(β) for α≤β and α<\cf(F(α)), then there is a cofinality preserving forcing extension in which κ remains Ramsey or strongly Ramsey respectively and 2δ=F(δ) for every regular cardinal δ.