def printable_value_record(value_record):
    """Prints a GPOS ValueRecord."""
    if value_record is None:
        return "<NULL>"

    if vars(value_record).keys() == ["XAdvance"]:
        return "%d" % value_record.XAdvance

    output_list = []
    for key in ["XPlacement", "YPlacement", "XAdvance", "YAdvance"]:
        output_list.append(vars(value_record).get(key, 0))
    return "<%d %d %d %d>" % tuple(output_list)