Catalysis of the reaction: S-adenosyl-L-methionine + histone H3 L-lysine (position 27) = S-adenosyl-L-homocysteine + histone H3 N6-methyl-L-lysine (position 27). This reaction is the addition of a methyl group onto lysine at position 27 of the histone H3 protein.